We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
After upgrading from 2.0.4 to 2.0.5 our tests which rely on module mocking via the __mocks__ folder are now failing with:
__mocks__
Error: ENOENT: no such file or directory, stat '/myproject/__mocks__/index.ts'
To reproduce this, you'll need:
/archiver
/index.ts
/ora
archiver
ora
vi.mock('ora')
It seems like (maybe after #6204) Vitest now expects the __mocks__ folder to have an index.* file, whereas before it wasn't needed.
index.*
For a StackBlitz repro see: https://stackblitz.com/edit/vitest-dev-vitest-snzivu?file=package.json,test%2Fbasic.test.ts,src%2Fbasic.ts&initialPath=__vitest__/. Run npm run test to reproduce.
npm run test
System: OS: macOS 14.6 CPU: (12) arm64 Apple M2 Max Memory: 1.99 GB / 32.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 20.16.0 - ~/.nvm/versions/node/v20.16.0/bin/node Yarn: 1.22.19 - ~/.nvm/versions/node/v20.16.0/bin/yarn npm: 10.8.1 - ~/.nvm/versions/node/v20.16.0/bin/npm Browsers: Chrome: 127.0.6533.89 Chrome Canary: 129.0.6631.0 Safari: 17.6
yarn
The text was updated successfully, but these errors were encountered:
index
Successfully merging a pull request may close this issue.
Describe the bug
After upgrading from 2.0.4 to 2.0.5 our tests which rely on module mocking via the
__mocks__
folder are now failing with:Reproduction
To reproduce this, you'll need:
__mocks__
folder with the following structure:__mocks__
/archiver
/index.ts
/ora
/index.ts
archiver
orora
) and callsvi.mock('ora')
It seems like (maybe after #6204) Vitest now expects the
__mocks__
folder to have anindex.*
file, whereas before it wasn't needed.For a StackBlitz repro see: https://stackblitz.com/edit/vitest-dev-vitest-snzivu?file=package.json,test%2Fbasic.test.ts,src%2Fbasic.ts&initialPath=__vitest__/. Run
npm run test
to reproduce.System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: