Skip to content

Commit 208a645

Browse files
authored
Fix boolean
1 parent f7a3542 commit 208a645

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/internal/test_runner/test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,23 +410,23 @@ class Test extends AsyncResource {
410410

411411
matchesTestNamePatterns() {
412412
let patterns;
413-
let boolOp = 0;
413+
let bool = true;
414414
if (testNamePatterns !== null) {
415415
patterns = testNamePatterns;
416416
} else if (testSkipPatterns !== null) {
417417
patterns = testSkipPatterns;
418-
boolOp = 1;
418+
bool = false;
419419
} else return true; // Nothing is specified, just continue
420420

421421
const matchesByNameOrParent = ArrayPrototypeSome(patterns, (re) =>
422422
RegExpPrototypeExec(re, this.name) !== null,
423423
) ||
424424
this.parent?.matchesTestNamePatterns();
425425

426-
if (matchesByNameOrParent) return !!boolOp; // true
426+
if (matchesByNameOrParent) return bool;
427427

428428
const testNameWithAncestors = StringPrototypeTrim(this.getTestNameWithAncestors());
429-
if (!testNameWithAncestors) return !boolOp; // false
429+
if (!testNameWithAncestors) return !bool;
430430

431431
return ArrayPrototypeSome(patterns, (re) => RegExpPrototypeExec(re, testNameWithAncestors) !== null);
432432
}

0 commit comments

Comments
 (0)