Skip to content

Commit 09de333

Browse files
test
1 parent fb1cae1 commit 09de333

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/tools/console.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,19 @@ describe('console', () => {
3535
);
3636
});
3737
});
38+
39+
it.only('work with primitive unhandled errors', async () => {
40+
await withBrowser(async (response, context) => {
41+
const page = await context.newPage();
42+
await page.setContent('<script>throw undefined;</script>');
43+
await listConsoleMessages.handler({params: {}}, response, context);
44+
const formattedResponse = await response.handle('test', context);
45+
const textContent = formattedResponse[0] as {text: string};
46+
assert.ok(
47+
textContent.text.includes('msgid=1 [error] undefined (0 args)'),
48+
);
49+
});
50+
});
3851
});
3952

4053
describe('get_console_message', () => {

0 commit comments

Comments
 (0)