From 9ed9c3503d06286ad188079f95def9d1867b7088 Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Fri, 26 Aug 2022 13:39:37 +0000 Subject: [PATCH] Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for modules. r=valentin Differential Revision: https://phabricator.services.mozilla.com/D155172 --- .eslintrc.js | 1 - modules/libjar/test/unit/test_crx.js | 4 ++-- modules/libjar/test/unit/test_fault_handler.js | 2 +- .../test/unit/test_jarinput_stream_zipreader_reference.js | 4 ++-- modules/libmar/tests/unit/head_libmar.js | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 3c8843fb9646..768a0f0d30df 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -480,7 +480,6 @@ module.exports = { "dom/**", "image/test/browser/browser_image.js", "layout/**", - "modules/**", "netwerk/**", "remote/**", "storage/test/unit/test_vacuum.js", diff --git a/modules/libjar/test/unit/test_crx.js b/modules/libjar/test/unit/test_crx.js index 1524afa0a9ce..7e48c3c89313 100644 --- a/modules/libjar/test/unit/test_crx.js +++ b/modules/libjar/test/unit/test_crx.js @@ -38,6 +38,6 @@ function run_test() { zipreader.close(); zipreader = null; Cu.forceGC(); - Assert.ok(stream.read(1024).length > 0); - Assert.ok(dirstream.read(100).length > 0); + Assert.ok(!!stream.read(1024).length); + Assert.ok(!!dirstream.read(100).length); } diff --git a/modules/libjar/test/unit/test_fault_handler.js b/modules/libjar/test/unit/test_fault_handler.js index 8e2660c92881..bfed18a2ba13 100644 --- a/modules/libjar/test/unit/test_fault_handler.js +++ b/modules/libjar/test/unit/test_fault_handler.js @@ -124,7 +124,7 @@ add_task(async function test() { Assert.throws( () => { while (true) { - Assert.ok(stream.read(1024).length > 0); + Assert.ok(!!stream.read(1024).length); } }, /NS_ERROR_FAILURE/, diff --git a/modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js b/modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js index f24c786bab0c..66d9bb873c4c 100644 --- a/modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js +++ b/modules/libjar/test/unit/test_jarinput_stream_zipreader_reference.js @@ -37,6 +37,6 @@ function run_test() { zipreader.close(); zipreader = null; Cu.forceGC(); - Assert.ok(stream.read(1024).length > 0); - Assert.ok(dirstream.read(100).length > 0); + Assert.ok(!!stream.read(1024).length); + Assert.ok(!!dirstream.read(100).length); } diff --git a/modules/libmar/tests/unit/head_libmar.js b/modules/libmar/tests/unit/head_libmar.js index 2091218cebd6..49ce2e8ba6e2 100644 --- a/modules/libmar/tests/unit/head_libmar.js +++ b/modules/libmar/tests/unit/head_libmar.js @@ -91,7 +91,7 @@ function run_tests(obj) { */ function createMAR(outMAR, dataDir, files) { // You cannot create an empy MAR. - Assert.ok(files.length > 0); + Assert.ok(!!files.length); // Get an nsIProcess to the signmar binary. let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);