Bug 1591009 - Restore overridden linting configuration for tests. r=mkmelin
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 24 Oct 2019 22:12:17 +1300
changeset 37363 216ae52769a8675888c33b953e972c3d03e1fda8
parent 37362 08af05c34c82f5367122d2c08661ffbf3b0e192d
child 37364 b2b10252b7913be853ffceb5a37e4a26e3c431f4
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersmkmelin
bugs1591009
Bug 1591009 - Restore overridden linting configuration for tests. r=mkmelin
.eslintrc.js
mailnews/addrbook/test/unit/test_bug1522453.js
mailnews/addrbook/test/unit/test_jsaddrbook.js
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -81,18 +81,18 @@ module.exports = {
       env: {
         node: true,
       },
     },
     {
       ...removeOverrides(xpcshellTestConfig),
       files: xpcshellTestPaths.map(path => `${path}**`),
       rules: {
+        ...xpcshellTestConfig.rules,
         "func-names": "off",
-        "mozilla/import-headjs-globals": "error",
       },
     },
     {
       // If it is an xpcshell head file, we turn off global unused variable checks, as it
       // would require searching the other test files to know if they are used or not.
       // This would be expensive and slow, and it isn't worth it for head files.
       // We could get developers to declare as exported, but that doesn't seem worth it.
       files: xpcshellTestPaths.map(path => `${path}head*.js`),
@@ -105,14 +105,14 @@ module.exports = {
           },
         ],
       },
     },
     {
       ...browserTestConfig,
       files: browserTestPaths.map(path => `${path}**`),
       rules: {
+        ...browserTestConfig.rules,
         "func-names": "off",
-        "mozilla/import-headjs-globals": "error",
       },
     },
   ],
 };
--- a/mailnews/addrbook/test/unit/test_bug1522453.js
+++ b/mailnews/addrbook/test/unit/test_bug1522453.js
@@ -65,16 +65,17 @@ add_task(async function() {
   equal(contact1.UID, listEnum.getNext().QueryInterface(Ci.nsIAbCard).UID);
   ok(listEnum.hasMoreElements());
   equal(contact3.UID, listEnum.getNext().QueryInterface(Ci.nsIAbCard).UID);
   ok(!listEnum.hasMoreElements());
 
   // Reload the address book manager.
   Services.obs.notifyObservers(null, "addrbook-reload");
   // Wait for files to close.
+  // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
   await new Promise(resolve => setTimeout(resolve, 2000));
 
   MailServices.ab.directories;
   book = MailServices.ab.getDirectory(kPABData.URI);
 
   // For some unknown reason this is necessary for book.addressLists to be populated.
   if (kPABData.dirType == 2) {
     book
--- a/mailnews/addrbook/test/unit/test_jsaddrbook.js
+++ b/mailnews/addrbook/test/unit/test_jsaddrbook.js
@@ -365,16 +365,17 @@ add_task(async function deleteContact() 
   equal(Array.from(book.addressLists.enumerate()).length, 0);
   equal(Array.from(book.childNodes).length, 0);
   equal(Array.from(book.childCards).length, 0);
 });
 
 add_task(async function deleteAddressBook() {
   MailServices.ab.deleteAddressBook(book.URI);
   // Wait for files to close.
+  // eslint-disable-next-line mozilla/no-arbitrary-setTimeout
   await new Promise(resolve => setTimeout(resolve, 2000));
 
   observer.checkEvents(["onItemRemoved", undefined, book]);
   ok(!Services.prefs.prefHasUserValue("ldap_2.servers.newbook.dirType"));
   ok(!Services.prefs.prefHasUserValue("ldap_2.servers.newbook.description"));
   ok(!Services.prefs.prefHasUserValue("ldap_2.servers.newbook.filename"));
   ok(!Services.prefs.prefHasUserValue("ldap_2.servers.newbook.uid"));
   let dbFile = Services.dirsvc.get("ProfD", Ci.nsIFile);