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 <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
MoLow authored and targos committed Mar 14, 2023
1 parent 89f31a1 commit c972612
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.fileURL('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} {`);
});
});

Expand Down

0 comments on commit c972612

Please sign in to comment.