Skip to content

Commit

Permalink
fix(tests): make eval test resilient to error format (#4793)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yury-s authored and aslushnikov committed Aug 1, 2019
1 parent 932c8cb commit e2db16f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/evaluation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ module.exports.addTests = function({testRunner, expect}) {
});
it('should reject promise with exception', async({page, server}) => {
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.message).toContain('not is not defined');
expect(error.message).toContain('not_existing_object');
});
it('should support thrown strings as error messages', async({page, server}) => {
let error = null;
Expand Down

0 comments on commit e2db16f

Please sign in to comment.