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
This commit is contained in:
Yury Semikhatsky 2019-08-15 12:03:48 -07:00 committed by Andrey Lushnikov
parent 417981aafa
commit 498492d4a3

View File

@ -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() {