diff options
author | Moshe Atlow <moshe@atlow.co.il> | 2022-12-22 03:17:25 +0200 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2023-03-14 07:54:14 +0100 |
commit | c972612c9dbbc0a933c77da18d7ee881f72c1040 (patch) | |
tree | 01ea8fd7bf08b57d0593fbb8c3c6d6e16bc8fee5 | |
parent | 89f31a1c7fb59c8f1b23889e6acb040de8c94ae2 (diff) | |
download | node-new-c972612c9dbbc0a933c77da18d7ee881f72c1040.tar.gz |
test: fix flakyness in test-runner reporter test
PR-URL: https://github.com/nodejs/node/pull/45930
Fixes: https://github.com/nodejs/node/issues/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>
-rw-r--r-- | test/parallel/test-runner-reporters.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/parallel/test-runner-reporters.js b/test/parallel/test-runner-reporters.js index 946a55d139..602c98bc31 100644 --- a/test/parallel/test-runner-reporters.js +++ b/test/parallel/test-runner-reporters.js @@ -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} {`); }); }); |