separate typecheck from runtime testing #3647
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See vitest-dev/vitest#6151
In short: tests pass even with assertions that should fail. Luckily there don't seem to be any of those right now, but you can reproduce this by checking out the
v4
branch and addingexpect(1).toEqual(2)
to one of the tests, and note thatpnpm test
will still pass:With this change it fails as expected:
It seems this is because when you specify
typecheck.include
, you're actually telling vitest to only test the types for that config. So you need two configs: one for runtime, and one for compile-time.Note 1: I updated vitest too since I thought originally this was a bug in vitest.
Note 2:
watch: false
doesn't seem to be allowed in the workspace variant of a Config.