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: docs/.vitepress/components/FeaturesList.vue
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,8 @@
26
26
<ListItem>Code coverage via <atarget="_blank"href="https://v8.dev/blog/javascript-code-coverage"rel="noopener noreferrer">v8</a> or <atarget="_blank"href="https://istanbul.js.org/"rel="noopener noreferrer">istanbul</a></ListItem>
<ListItem>Type Testing via <atarget="_blank"href="https://github.com/mmkal/expect-type"rel="noopener noreferrer">expect-type</a></ListItem>
By default, Vitest catches and reports all [unhandled rejections](https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event), [uncaught exceptions](https://nodejs.org/api/process.html#event-uncaughtexception) (in Node.js) and [error](https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event) events (in the [browser](/guide/browser/)).
266
+
267
+
You can disable this behaviour by catching them manually. Vitest assumes the callback is handled by you and won't report the error.
Alternatively, you can also ignore reported errors with a [`dangerouslyIgnoreUnhandledErrors`](/config/#dangerouslyignoreunhandlederrors) option. Vitest will still report them, but they won't affect the test result (exit code won't be changed).
293
+
294
+
If you need to test that error was not caught, you can create a test that looks like this:
0 commit comments