Skip to content

Commit

Permalink
fix: show error in the terminal, if "only" flag is used (#2696)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jan 17, 2023
1 parent a1b685c commit 24d6380
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/vitest/src/utils/collect.ts
Expand Up @@ -65,9 +65,11 @@ function skipAllTasks(suite: Suite) {
function checkAllowOnly(task: TaskBase, allowOnly?: boolean) {
if (allowOnly)
return
const error = new Error('[Vitest] Unexpected .only modifier. Remove it or pass --allowOnly argument to bypass this error')
task.result = {
state: 'fail',
error: new Error('[Vitest] Unexpected .only modifier. Remove it or pass --allowOnly argument to bypass this error'),
error,
errors: [error],
}
}

Expand Down

0 comments on commit 24d6380

Please sign in to comment.