diff --git a/test/evaluation.spec.js b/test/evaluation.spec.js index 26f19b56..3f68c8be 100644 --- a/test/evaluation.spec.js +++ b/test/evaluation.spec.js @@ -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() {