diff --git a/lib/api.js b/lib/api.js index 39a3c435c..ff0f0f74c 100644 --- a/lib/api.js +++ b/lib/api.js @@ -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)}); }