New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to properly handle "unhandled" exceptions #2493
Comments
This is a bug in Vitest, the fix is not released yet. |
You can ignore it by returning |
That does not work, it does not look like these errors go through the user log. Is this error coming from vite? I cannot find anything in vitest regarding this error message. |
Yes. |
Seems the error is coming directly from
|
Describe the bug
I have a test that asserts that an import throws, because the imported module is not found.
even though the actual error is caught by
expect().rejects.toThrowError()
it still shows up as unhandled.I tried marking all the folders as external, but that does nothing.
There is also this message:
which does not fail any test, but I also cannot get rid of, even if I set the importing file as external.
Reproduction
Minimal repro:
https://github.com/danez-labs/vitest-import-unhandled
npm i
npm test
Or the original problem:
netlify/zip-it-and-ship-it#1286
npm i
npm exec vitest -- run -t 'Throws on missing dependencies '
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: