Skip to content

Commit 24d6380

Browse files
authoredJan 17, 2023
fix: show error in the terminal, if "only" flag is used (#2696)
1 parent a1b685c commit 24d6380

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎packages/vitest/src/utils/collect.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ function skipAllTasks(suite: Suite) {
6565
function checkAllowOnly(task: TaskBase, allowOnly?: boolean) {
6666
if (allowOnly)
6767
return
68+
const error = new Error('[Vitest] Unexpected .only modifier. Remove it or pass --allowOnly argument to bypass this error')
6869
task.result = {
6970
state: 'fail',
70-
error: new Error('[Vitest] Unexpected .only modifier. Remove it or pass --allowOnly argument to bypass this error'),
71+
error,
72+
errors: [error],
7173
}
7274
}
7375

0 commit comments

Comments
 (0)
Please sign in to comment.