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:
parent
417981aafa
commit
498492d4a3
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user