Skip to content

Commit

Permalink
fix: show error in the terminal, if "only" flag is used (vitest-dev#2696
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sheremet-va committed Jan 18, 2023
1 parent 3209de6 commit c8538f2
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 c8538f2

Please sign in to comment.