Skip to content

Commit 757ea9b

Browse files
committed
fix
1 parent 941e458 commit 757ea9b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/sequential/test-watch-mode.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,18 @@ describe('watch mode', { concurrency: false, timeout: 60_0000 }, () => {
183183
isReady: (data) => data.startsWith('running'),
184184
});
185185

186+
assert.strictEqual(stderr, '');
187+
const expected = ['running', `Restarting ${inspect(file)}`, 'Waiting for graceful termination...',
188+
'exiting gracefully', `Gracefully restarted ${inspect(file)}`, 'running'].join('\n');
189+
186190
// This message appearing is very flaky depending on a race between the
187191
// inner process and the outer process. it is acceptable for the message not to appear
188192
// as long as the SIGTERM handler is respected.
189193
if (stdout.includes('Waiting for graceful termination...')) {
190-
assert.strictEqual(stdout, ['running', `Restarting ${inspect(file)}`, 'Waiting for graceful termination...',
191-
'exiting gracefully', `Gracefully restarted ${inspect(file)}`, 'running', 'exiting gracefully', ''].join('\n'));
194+
assert(stdout.startsWith(expected));
192195
} else {
193-
assert.strictEqual(stdout, ['running', `Restarting ${inspect(file)}`, 'exiting gracefully', 'running', ''].join('\n'));
196+
assert(stdout.startsWith(removeGraceMessage(expected)));
194197
}
195-
assert.strictEqual(stderr, '');
196198
});
197199

198200
it('should pass arguments to file', async () => {

0 commit comments

Comments
 (0)