Skip to content

Commit 166ad09

Browse files
fixup: code review improvement for resolveHookRunCount
Co-authored-by: Antoine du Hamel <[email protected]>
1 parent d2f2ec0 commit 166ad09

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/es-module/test-esm-initialization.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { spawnSync } from 'node:child_process';
1616
{ encoding: 'utf8' },
1717
);
1818

19-
const resolveHookRunCount = [...(stdout.matchAll(/resolve passthru/g) ?? new Array())]
20-
.length - 1; // less 1 because the first is the needle
19+
// Length minus 1 because the first match is the needle.
20+
const resolveHookRunCount = (stdout.match(/resolve passthru/g)?.length ?? 0) - 1;
2121

2222
assert.strictEqual(stderr, '');
2323
/**

0 commit comments

Comments
 (0)