-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Describe the bug
The following test passes!
import { expect, test } from 'vitest';
test('huh', () => {
expect(1).toBe(2);
});With this config:
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['**/*.test.ts'],
typecheck: {
enabled: true,
ignoreSourceErrors: true,
include: ['**/*.test.ts'],
},
},
});Note: commenting out the whole typecheck prop makes the test fail as expected, as does commenting out typecheck.include.
Reproduction
https://stackblitz.com/edit/vitest-dev-vitest-hw9uz6?file=test/huh.test.ts
You can also repro with the zod repo by putting a bad assertion in one of the tests and observing that they continue to pass.
(FYI @colinhacks because of this zod might have a bunch of broken tests on the v4 branch - that's where I found this, with vitest ^1.6.0, not sure about other branches)
Note: with "vitest": "latest" the "Tests" still pass but there's an unhandled error with no extra info.
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vitest: 2.0.3 => 2.0.3Used 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.
Reactions are currently unavailable