Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
  • Loading branch information
NullDivision and SimenB committed Nov 24, 2020
1 parent 2f260e7 commit bdf0fa5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/jest-core/src/plugins/FailedTestsInteractive.ts
Expand Up @@ -48,7 +48,10 @@ export default class FailedTestsInteractivePlugin extends BaseWatchPlugin {
updateConfigAndRun: UpdateConfigCallback,
): Promise<void> {
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({
Expand All @@ -57,7 +60,9 @@ export default class FailedTestsInteractivePlugin extends BaseWatchPlugin {
testPathPattern: failure?.path || '',
});

if (!this._manager.isActive()) resolve();
if (!this._manager.isActive()) {
resolve();
}
});
});
}
Expand Down

0 comments on commit bdf0fa5

Please sign in to comment.