Skip to content

Commit

Permalink
fixup: code review improvement for resolveHookRunCount
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <[email protected]>
  • Loading branch information
JakobJingleheimer and aduh95 committed Jul 10, 2022
1 parent d2f2ec0 commit 166ad09
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/es-module/test-esm-initialization.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { spawnSync } from 'node:child_process';
{ encoding: 'utf8' },
);

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

assert.strictEqual(stderr, '');
/**
Expand Down

0 comments on commit 166ad09

Please sign in to comment.