From e2db16f8983ffb4ab8a25a4847aa3d9204c31ee4 Mon Sep 17 00:00:00 2001 From: Yury Semikhatsky Date: Thu, 1 Aug 2019 14:18:35 -0700 Subject: [PATCH] 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. --- test/evaluation.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/evaluation.spec.js b/test/evaluation.spec.js index 896745ce..c25df724 100644 --- a/test/evaluation.spec.js +++ b/test/evaluation.spec.js @@ -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;