diff --git a/extensions/notebook-renderers/src/test/notebookRenderer.test.ts b/extensions/notebook-renderers/src/test/notebookRenderer.test.ts index 0f747900377..5c24b4f494a 100644 --- a/extensions/notebook-renderers/src/test/notebookRenderer.test.ts +++ b/extensions/notebook-renderers/src/test/notebookRenderer.test.ts @@ -15,13 +15,12 @@ global.document = dom.window.document; suite('Notebook builtin output renderer', () => { const error = { - name: "NameError", - message: "name 'x' is not defined", + name: "TypeError", + message: "Expected type `str`, but received type ``", stack: "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m" + - "\n\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)" + - "\nCell \u001b[1;32mIn[3], line 1\u001b[0m" + - "\n\u001b[1;32m----> 1\u001b[0m \u001b[39mprint\u001b[39m(x)" + - "\n\n\u001b[1;31mNameError\u001b[0m: name 'x' is not defined" + "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)" + + "\u001b[1;32mc:\\src\\test\\ws1\\testing.py\u001b[0m in \u001b[0;36mline 2\n\u001b[0;32m 35\u001b[0m \u001b[39m# %%\u001b[39;00m\n\u001b[1;32m----> 36\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mTypeError\u001b[39;00m(\u001b[39m'\u001b[39m\u001b[39merror = f\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mExpected type `str`, but received type `\u001b[39m\u001b[39m{\u001b[39m\u001b[39mtype(name)}`\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m'\u001b[39m)\n" + + "\u001b[1;31mTypeError\u001b[0m: Expected type `str`, but received type ``\"" }; const errorMimeType = 'application/vnd.code.notebook.error'; @@ -233,7 +232,7 @@ suite('Notebook builtin output renderer', () => { assert.ok(firstOutputElement.innerHTML.indexOf('>first stream content') > -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); assert.ok(firstOutputElement.innerHTML.indexOf('appended1') > -1, `Content was not appended to output element: ${outputHtml.cellElement.innerHTML}`); - assert.ok(secondOutputElement.innerHTML.indexOf('>NameError -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); + assert.ok(secondOutputElement.innerHTML.indexOf('>TypeError -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); assert.ok(thirdOutputElement.innerHTML.indexOf('>second stream content') > -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); assert.ok(thirdOutputElement.innerHTML.indexOf('appended3') > -1, `Content was not appended to output element: ${outputHtml.cellElement.innerHTML}`); }); @@ -287,7 +286,9 @@ suite('Notebook builtin output renderer', () => { assert.ok(outputElement.classList.contains('remove-padding'), 'Padding should be removed for scrollable outputs'); assert.ok(inserted.classList.contains('word-wrap') && inserted.classList.contains('scrollable'), `output content classList should contain word-wrap and scrollable ${inserted.classList}`); - assert.ok(inserted.innerHTML.indexOf('>: name \'x\' is not defined -1, `Content was not added to output element:\n ${outputElement.innerHTML}`); + assert.ok(inserted.innerHTML.indexOf('>Expected type `str`, but received type') > -1, `Content was not added to output element:\n ${outputElement.innerHTML}`); + assert.ok(inserted.textContent!.indexOf('Expected type `str`, but received type ``') > -1, `Content was not added to output element:\n ${outputElement.textContent}`); + assert.ok(inserted.textContent!.indexOf(' { @@ -303,7 +304,7 @@ suite('Notebook builtin output renderer', () => { await renderer!.renderOutputItem(outputItem2, outputElement); const inserted = outputElement.firstChild as HTMLElement; - assert.ok(inserted.innerHTML.indexOf('>: name \'x\' is not definedreplaced content { await renderer!.renderOutputItem(outputItem3, thirdOutputElement); assert.ok(firstOutputElement.innerHTML.indexOf('>first stream content -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); - assert.ok(secondOutputElement.innerHTML.indexOf('>NameError -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); + assert.ok(secondOutputElement.innerHTML.indexOf('>TypeError -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); assert.ok(thirdOutputElement.innerHTML.indexOf('>second stream content -1, `Content was not added to output element: ${outputHtml.cellElement.innerHTML}`); });