Skip to content

Commit 32f282f

Browse files
authored
Ensure watch mode works outside of its integration tests
Somewhere between developing the watch mode and adding test coverage, a mechanism was introduced to control watch mode in its integration tests. Ironically watch mode relied on this mechanism and no longer worked in actual use. Fixes #3270
1 parent cf7a288 commit 32f282f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/cli.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ export default async function loadCli() { // eslint-disable-line complexity
522522
providers,
523523
reporter,
524524
stdin: process.stdin,
525-
signal: abortController.signal,
525+
signal: abortController?.signal,
526526
});
527527
} else {
528528
let debugWithoutSpecificFile = false;

lib/watcher.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -370,15 +370,15 @@ async function * plan({api, filter, globs, projectDir, providers, stdin, abortSi
370370
}
371371
});
372372

373-
abortSignal.addEventListener('abort', () => {
373+
abortSignal?.addEventListener('abort', () => {
374374
signalChanged?.({});
375375
});
376376

377377
// And finally, the watch loop.
378-
while (!abortSignal.aborted) {
378+
while (abortSignal?.aborted !== true) {
379379
const {testFiles: files = [], runOnlyExclusive = false} = await changed; // eslint-disable-line no-await-in-loop
380380

381-
if (abortSignal.aborted) {
381+
if (abortSignal?.aborted) {
382382
break;
383383
}
384384

0 commit comments

Comments
 (0)