From 905139f29577cbecfeb25a7922c384f6ebc0e8fd Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Fri, 9 Jul 2021 15:13:07 +0000 Subject: [PATCH] Bug 1719835 - [devtools] Fix beta simulation perma fail on browser_webconsole_stubs_page_error.js. r=bomsy. The error message seems to be different in Nighly and Beta, but I wasn't able to find any pref that is driving this. Since the error message itself isn't super relevant, and given that we're at the end of the cycle, this patch is only modifying the expression so we get a different error. Differential Revision: https://phabricator.services.mozilla.com/D119520 --- .../test/browser/browser_webconsole_stubs_page_error.js | 2 +- .../webconsole/test/node/components/page-error.test.js | 2 +- .../client/webconsole/test/node/fixtures/stubs/pageError.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/devtools/client/webconsole/test/browser/browser_webconsole_stubs_page_error.js b/devtools/client/webconsole/test/browser/browser_webconsole_stubs_page_error.js index 36a6cbc871af..ad5f0ebb67f1 100644 --- a/devtools/client/webconsole/test/browser/browser_webconsole_stubs_page_error.js +++ b/devtools/client/webconsole/test/browser/browser_webconsole_stubs_page_error.js @@ -244,7 +244,7 @@ function getCommands() { `Promise reject Error Object with error cause`, `Promise.resolve().then(() => { try { - a.b.c + unknownFunc(); } catch(e) { throw new Error("something went wrong", { cause: e }) } diff --git a/devtools/client/webconsole/test/node/components/page-error.test.js b/devtools/client/webconsole/test/node/components/page-error.test.js index c6e0a85792a7..da06e7df0d94 100644 --- a/devtools/client/webconsole/test/node/components/page-error.test.js +++ b/devtools/client/webconsole/test/node/components/page-error.test.js @@ -375,7 +375,7 @@ describe("PageError component:", () => { expect(text).toBe( [ `Uncaught (in promise) Error: something went wrong`, - `Caused by: TypeError: can't access property "c", a.b is undefined`, + `Caused by: ReferenceError: unknownFunc is not defined`, ].join("\n") ); expect(wrapper.hasClass("error")).toBe(true); diff --git a/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js b/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js index 09e952eaef40..1f2183b57142 100644 --- a/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js +++ b/devtools/client/webconsole/test/node/fixtures/stubs/pageError.js @@ -2447,7 +2447,7 @@ rawPackets.set(`Promise reject Error Object with error cause`, { "cause": { "type": "object", "actor": "server0.conn0.child4/obj83", - "class": "TypeError", + "class": "ReferenceError", "ownPropertyLength": 4, "extensible": true, "frozen": false, @@ -2455,8 +2455,8 @@ rawPackets.set(`Promise reject Error Object with error cause`, { "isError": true, "preview": { "kind": "Error", - "name": "TypeError", - "message": "can't access property \"c\", a.b is undefined", + "name": "ReferenceError", + "message": "unknownFunc is not defined", "stack": "@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:3:9\npromise callback*@http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html:1:19\n", "fileName": "http://example.com/browser/devtools/client/webconsole/test/browser/test-console-api.html", "lineNumber": 3,