From 208a645195a88164abdd8084d6fcbbb7a898d65e Mon Sep 17 00:00:00 2001 From: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com> Date: Sun, 14 Apr 2024 13:28:47 -0400 Subject: [PATCH] Fix boolean --- lib/internal/test_runner/test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/internal/test_runner/test.js b/lib/internal/test_runner/test.js index 01e31d9e411445..373a4004e8ab97 100644 --- a/lib/internal/test_runner/test.js +++ b/lib/internal/test_runner/test.js @@ -410,12 +410,12 @@ class Test extends AsyncResource { matchesTestNamePatterns() { let patterns; - let boolOp = 0; + let bool = true; if (testNamePatterns !== null) { patterns = testNamePatterns; } else if (testSkipPatterns !== null) { patterns = testSkipPatterns; - boolOp = 1; + bool = false; } else return true; // Nothing is specified, just continue const matchesByNameOrParent = ArrayPrototypeSome(patterns, (re) => @@ -423,10 +423,10 @@ class Test extends AsyncResource { ) || this.parent?.matchesTestNamePatterns(); - if (matchesByNameOrParent) return !!boolOp; // true + if (matchesByNameOrParent) return bool; const testNameWithAncestors = StringPrototypeTrim(this.getTestNameWithAncestors()); - if (!testNameWithAncestors) return !boolOp; // false + if (!testNameWithAncestors) return !bool; return ArrayPrototypeSome(patterns, (re) => RegExpPrototypeExec(re, testNameWithAncestors) !== null); }