-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Describe the bug
After enabling typecheck and including regular test files (using include typecheck config option), when running the tests, only typecheck is performed, with the tests themselves passing regardless of any value assertions.
Setting only typecheck option to false doesn't seem to do anything.
Upd1: Current solution is to separate the regular tests and type tests to different files.
Upd2: Separating regular tests and type tests seems to result in an issue when saving the regular test file. Instead of rerunning the just-saved regular test file, instead the type test file is being rerun. Created an issue: #5020
Reproduction
Repo: https://github.com/murolem/vitest-issue-when-typecheck-is-used-tests-are-not-failing
Run npm run test.
Enable/disable typecheck in the config to see the issue.
System Info
System:
OS: Windows 11 10.0.22621
CPU: (16) x64 AMD Ryzen 7 5800X 8-Core Processor
Memory: 8.01 GB / 31.93 GB
Binaries:
Node: 21.1.0 - C:\Program Files\nodejs\node.EXE
npm: 10.2.2 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Chromium (120.0.2210.144)
npmPackages:
vite: ^5.0.11 => 5.0.11
vitest: ^1.2.1 => 1.2.0Used 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.