Skip to content

Commit 498492d

Browse files
yury-saslushnikov
authored andcommitted
test: add a test for errors inside promise (#4838)
The bug was fixed upstream in V8 and rolled into chromium at r686227. This adds a test. Fix #4651
1 parent 417981a commit 498492d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/evaluation.spec.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,13 @@ module.exports.addTests = function({testRunner, expect}) {
255255
const a = await page.evaluate(() => Array(100 * 1024 * 1024 + 1).join('a'));
256256
expect(a.length).toBe(100 * 1024 * 1024);
257257
});
258+
it('should throw error with detailed information on exception inside promise ', async({page, server}) => {
259+
let error = null;
260+
await page.evaluate(() => new Promise(() => {
261+
throw new Error('Error in promise');
262+
})).catch(e => error = e);
263+
expect(error.message).toContain('Error in promise');
264+
});
258265
});
259266

260267
describe('Page.evaluateOnNewDocument', function() {

0 commit comments

Comments
 (0)