Skip to content

Commit

Permalink
feat: press f to rerun only failed tests (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
btea committed May 10, 2022
1 parent 35c1b52 commit 3c6f991
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vitest/src/node/core.ts
Expand Up @@ -246,7 +246,7 @@ export class Vitest {
await this.rerunFiles(files, trigger)
}

async returnFailed() {
async rerunFailed() {
await this.rerunFiles(this.state.getFailedFilepaths(), 'rerun failed')
}

Expand Down
3 changes: 3 additions & 0 deletions packages/vitest/src/node/stdin.ts
Expand Up @@ -42,6 +42,9 @@ export function registerConsoleShortcuts(ctx: Vitest) {
// rerun all tests
if (name === 'a' || name === 'return')
return ctx.rerunFiles(undefined, 'rerun all')
// rerun only failed tests
if (name === 'f')
return ctx.rerunFailed()
// change testNamePattern
if (name === 't')
return inputNamePattern()
Expand Down

0 comments on commit 3c6f991

Please sign in to comment.