Skip to content

Commit

Permalink
test: add a test for errors inside promise (#4838)
Browse files Browse the repository at this point in the history
The bug was fixed upstream in V8 and rolled into chromium at r686227.
This adds a test.

Fix #4651
  • Loading branch information
yury-s authored and aslushnikov committed Aug 15, 2019
1 parent 417981a commit 498492d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/evaluation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,13 @@ module.exports.addTests = function({testRunner, expect}) {
const a = await page.evaluate(() => Array(100 * 1024 * 1024 + 1).join('a'));
expect(a.length).toBe(100 * 1024 * 1024);
});
it('should throw error with detailed information on exception inside promise ', async({page, server}) => {
let error = null;
await page.evaluate(() => new Promise(() => {
throw new Error('Error in promise');
})).catch(e => error = e);
expect(error.message).toContain('Error in promise');
});
});

describe('Page.evaluateOnNewDocument', function() {
Expand Down

0 comments on commit 498492d

Please sign in to comment.