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 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
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.