vitest: Error: No test suite found
Describe the bug
not sure what is happening, but if I comment the console.log()
the test is fine, if that line is uncommented I get Error: No test suite found in file ...
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-7ztept?devtoolsheight=33&file=test/index.test.ts
System Info
System:
OS: macOS 12.1
CPU: (10) arm64 Apple M1 Pro
Memory: 139.27 MB / 32.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.14.0 - ~/.nvm/versions/node/v15.14.0/bin/node
Yarn: 1.22.15 - ~/.nvm/versions/node/v15.14.0/bin/yarn
npm: 7.7.6 - ~/.nvm/versions/node/v15.14.0/bin/npm
Browsers:
Chrome: 98.0.4758.109
Edge: 98.0.1108.62
Firefox: 96.0.3
Safari: 15.2
npmPackages:
@vitejs/plugin-react: ^1.2.0 => 1.2.0
vitest: ^0.5.5 => 0.5.5
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 22 (4 by maintainers)
Commits related to this issue
- fix: esm compactiblity, close #847 — committed to chaii3/vitest by antfu 3 years ago
Hi all,
I’m currently experiencing this issue:
Please reopen this, it’s still an issue if the root project folder doesn’t match the package name by case. In my case, the folder was “Engine”, the package name was “engine”.
Can you try the same with the previous version (
"vitest": "0.5.4"
)?I think that the last release (
0.5.5
) is shadowing real errors.I’m noticing this issue when using
pnpx
(Monorepo using pnpm, my working directory is inside a library next to the testfile likeproject/packages/a/src/foo/
, runningpnpx vitest foo.spec.ts
), using npx, vitest works fine.Looks like the no test suite found error masking is fixed in the latest release
change
vitest
tonpx vitest
work for meCan confirm errors are not shadowed on 0.5.4 with the following config (and a
Failed to resolve import "@testing-library/jest-dom" from "src/test/setup.ts"
shadowed error with 0.5.5)