Skip to content

Commit c972612

Browse files
MoLowtargos
authored andcommitted
test: fix flakyness in test-runner reporter test
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>
1 parent 89f31a1 commit c972612

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/parallel/test-runner-reporters.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ describe('node:test reporters', { concurrency: true }, () => {
8989
['--test', '--test-reporter', fixtures.fileURL('test-runner/custom_reporters/', filename),
9090
testFile]);
9191
assert.strictEqual(child.stderr.toString(), '');
92-
assert.strictEqual(child.stdout.toString(), `${filename} {"test:start":5,"test:pass":2,"test:fail":3,"test:plan":3,"test:diagnostic":7}`);
92+
const stdout = child.stdout.toString();
93+
assert.match(stdout, /{"test:start":5,"test:pass":2,"test:fail":3,"test:plan":3,"test:diagnostic":\d+}$/);
94+
assert.strictEqual(stdout.slice(0, filename.length + 2), `${filename} {`);
9395
});
9496
});
9597

0 commit comments

Comments
 (0)