diff --git a/packages/jest-core/src/plugins/FailedTestsInteractive.ts b/packages/jest-core/src/plugins/FailedTestsInteractive.ts index feda8443af14..7759c99d8d0f 100644 --- a/packages/jest-core/src/plugins/FailedTestsInteractive.ts +++ b/packages/jest-core/src/plugins/FailedTestsInteractive.ts @@ -48,7 +48,10 @@ export default class FailedTestsInteractivePlugin extends BaseWatchPlugin { updateConfigAndRun: UpdateConfigCallback, ): Promise { return new Promise(resolve => { - if (!this._failedTestAssertions?.length) return resolve(); + if (!this._failedTestAssertions || this._failedTestAssertions.length === 0) { + resolve(); + return; + } this._manager.run(this._failedTestAssertions, failure => { updateConfigAndRun({ @@ -57,7 +60,9 @@ export default class FailedTestsInteractivePlugin extends BaseWatchPlugin { testPathPattern: failure?.path || '', }); - if (!this._manager.isActive()) resolve(); + if (!this._manager.isActive()) { + resolve(); + } }); }); }