You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/runner/src/suite.ts
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,13 @@ let currentTestFilepath: string
187
187
188
188
functionassert(condition: any,message: string){
189
189
if(!condition){
190
-
thrownewError(`Vitest failed to find ${message}. This is a bug in Vitest. Please, open an issue with reproduction.`)
190
+
thrownewError(
191
+
`Vitest failed to find ${message}. One of the following is possible:`
192
+
+'\n- "vitest" is imported directly without running "vitest" command'
193
+
+'\n- "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)'
194
+
+'\n- "vitest" is imported inside Vite / Vitest config file'
195
+
+'\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n',
0 commit comments