[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix: don't print typecheck warning more than once (#10461)

authored by

Vladimir and committed by
GitHub
(May 26, 2026, 5:11 PM +0200) 152750ec a303fecb

+8 -5
+1 -1
test/typescript/test/runner.test.ts
··· 85 85 86 86 const message = removeLines(stderr.replace(resolve(import.meta.dirname, '..'), '<root>')) 87 87 88 - expect(message).toMatchSnapshot() 88 + expect(message.replace('Testing types with tsc and vue-tsc is an experimental feature.\nBreaking changes might not follow SemVer, please pin Vitest\'s version when using it.\n', '')).toMatchSnapshot() 89 89 }) 90 90 }) 91 91
+1 -3
test/typescript/test/__snapshots__/runner.test.ts.snap
··· 100 100 `; 101 101 102 102 exports[`should fail > typechecks empty "include" but with tests 1`] = ` 103 - "Testing types with tsc and vue-tsc is an experimental feature. 104 - Breaking changes might not follow SemVer, please pin Vitest's version when using it. 105 - ⎯⎯ Unhandled Errors ⎯⎯ 103 + "⎯⎯ Unhandled Errors ⎯⎯ 106 104 107 105 Vitest caught 1 unhandled error during the test run. 108 106 This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.
+6 -1
packages/vitest/src/node/config/resolveConfig.ts
··· 146 146 } 147 147 } 148 148 149 + // warn only once, check one PER PROCESS, not per instance, 150 + // that's why it's on a module-level 151 + let warnedTypeCheck = false 152 + 149 153 export function resolveConfig( 150 154 vitest: Vitest, 151 155 options: UserConfig, ··· 820 824 resolved.typecheck ??= {} as any 821 825 resolved.typecheck.enabled ??= false 822 826 823 - if (resolved.typecheck.enabled) { 827 + if (resolved.typecheck.enabled && !warnedTypeCheck) { 828 + warnedTypeCheck = true 824 829 logger.console.warn( 825 830 c.yellow( 826 831 'Testing types with tsc and vue-tsc is an experimental feature.\nBreaking changes might not follow SemVer, please pin Vitest\'s version when using it.',