Skip to content

Commit

Permalink
test: fix flakyness in test-runner reporter test
Browse files Browse the repository at this point in the history
PR-URL: #45930
Fixes: #45929
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
  • Loading branch information
MoLow authored and targos committed Jan 1, 2023
1 parent 192ca1a commit 40bffe1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/parallel/test-runner-reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ describe('node:test reporters', { concurrency: true }, () => {
['--test', '--test-reporter', fixtures.path('test-runner/custom_reporters/', filename),
testFile]);
assert.strictEqual(child.stderr.toString(), '');
assert.strictEqual(child.stdout.toString(), `${filename} {"test:start":5,"test:pass":2,"test:fail":3,"test:plan":3,"test:diagnostic":7}`);
const stdout = child.stdout.toString();
assert.match(stdout, /{"test:start":5,"test:pass":2,"test:fail":3,"test:plan":3,"test:diagnostic":\d+}$/);
assert.strictEqual(stdout.slice(0, filename.length + 2), `${filename} {`);
});
});
});

0 comments on commit 40bffe1

Please sign in to comment.