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
__mocks__ folder doesn't work #552
Comments
We don't support automocking. You need to manually call For external libraries we use Docs: https://vitest.dev/api/#vi-mock Working stackblitz: https://stackblitz.com/edit/node-e1vryb?file=src/hooks/__mocks__/index.ts |
What about paths like |
yes |
Ok, that doesn't work also :) |
No debugging option available at the moment. You can look into If nothing works, please create an issue with reproduction. |
I tried it out in the stackblitz repo |
Describe the bug
__mocks__
is a common way (with Jest) to mock node-modules (and something helpers). But currently it doesn't seem to work. It works for my regular Jest setup that usesvite-tsconfig-paths
.Reproduction
https://stackblitz.com/edit/node-b3r6jj?file=src%2FSomeComponent.spec.tsx
I tried
vite-tsconfig-paths
(similar to my own setup), as well as Vite's own resolve alias config. Neither work.System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: