Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for head_devtools_inspector_sidebar.js. r?jdescottes draft
authorMark Banner <standard8@mozilla.com>
Fri, 01 Jun 2018 12:49:41 +0100
changeset 804041 1b4273dbbf1c516076f453e06eb77f059dc4bb6b
parent 804003 a358755643e92f8fc55a23e3ab1fbf88695b8bf3
child 804042 3d36e02d0f4b83993dd3f7c3162ecbb3c6ed6bb4
push id112291
push userbmo:standard8@mozilla.com
push dateTue, 05 Jun 2018 13:20:29 +0000
reviewersjdescottes
bugs1466497
milestone62.0a1
Bug 1466497 - Enable ESLint rule require-expected-throws-or-rejects for head_devtools_inspector_sidebar.js. r?jdescottes MozReview-Commit-ID: LnOPs92HNPK
.eslintrc.js
devtools/client/inspector/extensions/test/head_devtools_inspector_sidebar.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -47,17 +47,16 @@ module.exports = {
     ],
     "rules": {
       "mozilla/no-define-cc-etc": "off",
     }
   }, {
     // XXX Bug 1452706. These directories are still being fixed, so turn off
     //  mozilla/require-expected-throws-or-rejects for now.
     "files": [
-      "devtools/client/inspector/extensions/test/head_devtools_inspector_sidebar.js",
       "storage/test/unit/**",
     ],
     "rules": {
       "mozilla/require-expected-throws-or-rejects": "off",
     }
   }, {
     // XXX Bug 1452706. These directories are still being fixed, so turn off
     //  mozilla/require-expected-throws-or-rejects for now.
--- a/devtools/client/inspector/extensions/test/head_devtools_inspector_sidebar.js
+++ b/devtools/client/inspector/extensions/test/head_devtools_inspector_sidebar.js
@@ -35,17 +35,17 @@ function getExtensionSidebarActors(inspe
 
 // Test that the specified objectValueGrip actors have been released
 // on the remote debugging server
 // (used in browser_ext_devtools_panels_elements_sidebar.js).
 async function expectNoSuchActorIDs(client, actors) {
   info(`Test that all the objectValueGrip actors have been released`);
   for (const actor of actors) {
     await Assert.rejects(client.request({to: actor, type: "requestTypes"}),
-                         `No such actor for ID: ${actor}`);
+                         err => err.message == `No such actor for ID: ${actor}`);
   }
 }
 
 function waitForObjectInspector(panelDoc, waitForNodeWithType = "object") {
   const selector = `.object-inspector .objectBox-${waitForNodeWithType}`;
   return ContentTaskUtils.waitForCondition(() => {
     return panelDoc.querySelectorAll(selector).length > 0;
   });