fix(tests): make eval test resilient to error format (#4793)

Make eval test resilient to variations in error message format between browsers.This will make the test pass without alternations in WebKit as well as Crhrome and Firefox.
This commit is contained in:
Yury Semikhatsky 2019-08-01 14:18:35 -07:00 committed by Andrey Lushnikov
parent 932c8cbe9a
commit e2db16f898

View File

@ -121,9 +121,9 @@ module.exports.addTests = function({testRunner, expect}) {
}); });
it('should reject promise with exception', async({page, server}) => { it('should reject promise with exception', async({page, server}) => {
let error = null; let error = null;
await page.evaluate(() => not.existing.object.property).catch(e => error = e); await page.evaluate(() => not_existing_object.property).catch(e => error = e);
expect(error).toBeTruthy(); expect(error).toBeTruthy();
expect(error.message).toContain('not is not defined'); expect(error.message).toContain('not_existing_object');
}); });
it('should support thrown strings as error messages', async({page, server}) => { it('should support thrown strings as error messages', async({page, server}) => {
let error = null; let error = null;