Skip to content

Commit 6d736a5

Browse files
MoLowrichardlau
authored andcommitted
test: fix watch mode test flake
PR-URL: #44739 Backport-PR-URL: #44976 Fixes: #44735 Reviewed-By: Erick Wendel <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]>
1 parent 543d3d2 commit 6d736a5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/sequential/test-watch-mode.mjs

+6-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ describe('watch mode', { concurrency: true, timeout: 60_0000 }, () => {
9494
const file = fixtures.path('watch-mode/failing.js');
9595
const { stderr, stdout } = await spawnWithRestarts({ file });
9696

97+
// Use match first to pretty print diff on failure
9798
assert.match(stderr, /Error: fails\r?\n/);
98-
assert.strictEqual(stderr.match(/Error: fails\r?\n/g).length, 2);
99+
// Test that failures happen once per restart
100+
assert(stderr.match(/Error: fails\r?\n/g).length >= 2);
99101
assertRestartedCorrectly({
100102
stdout,
101103
messages: { completed: `Failed running ${inspect(file)}`, restarted: `Restarting ${inspect(file)}` },
@@ -206,7 +208,9 @@ describe('watch mode', { concurrency: true, timeout: 60_0000 }, () => {
206208
});
207209
});
208210

209-
it('should not load --import modules in main process', async () => {
211+
it('should not load --import modules in main process', {
212+
skip: 'enable once --import is backported',
213+
}, async () => {
210214
const file = createTmpFile('');
211215
const imported = fixtures.fileURL('watch-mode/process_exit.js');
212216
const args = ['--import', imported, file];

0 commit comments

Comments
 (0)