Skip to content

Commit

Permalink
Fix potential bug with watch mode when no failed test files are written
Browse files Browse the repository at this point in the history
Don't emit the 'touched-files' event, since the watcher assumes that comes with a files value.

Fixes #3285
  • Loading branch information
novemberborn committed Jan 11, 2024
1 parent fde8671 commit 35f6c86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ export default class Api extends Emittery {
// Allow shared workers to clean up before the run ends.
await Promise.all(deregisteredSharedWorkers);
const files = scheduler.storeFailedTestFiles(runStatus, this.options.cacheEnabled === false ? null : this._createCacheDir());
runStatus.emitStateChange({type: 'touched-files', files});
if (files) {
runStatus.emitStateChange({type: 'touched-files', files});
}
} catch (error) {
runStatus.emitStateChange({type: 'internal-error', err: serializeError(error)});
}
Expand Down

0 comments on commit 35f6c86

Please sign in to comment.