Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: press f to rerun only failed tests #1283

Merged
merged 1 commit into from May 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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