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 <erick.workspace@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
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

Lines changed: 6 additions & 2 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy