Description
Describe the bug
Using vitest.workspace.ts
, I cycle through all the folders in the tests
directory.
For each folder, I check for the existence of a file starting with tsconfig.
For each matching file, I create a workspace with test.typecheck.tsconfig
referencing the corresponding config file.
Caution
When running vitest
, I expect each case folder to contain two temporary tsconfig.vitest-temp
files.
Currently, only one is present.
Note
It looks like that thetsconfig.vitest-temp.json
name iswritten here:
vitest/packages/vitest/src/typecheck/parse.ts
Lines 78 to 81 in 78b62ff
Maybe the issue can be fixed by using the original filename alongside
original-name-without-extenstion.vitest-temp.json
?
The original issue was reported in i18next repository
Reproduction
I setup a small repository where the issue can be easily reproduced:
https://github.com/marcalexiei/vitest-typecheck-ts-config-reproduction
To show this behaviour I created a GitHub action.
An example run can be found at this page
When running the case-1
workspace, no errors are produced.
However when running case-1-noStrict
workspace alone results in an error.
Running all workspaces produces inconsistent results:
- No errors
- Workspaces within the same folder show either errors or no errors, depending on which of the two
tsconfig
files is written in the temp file - Parsing errors occur with the
tsconfig.vitest-temp.json
file
System Info
System:
OS: macOS 15.2
CPU: (8) arm64 Apple M3
Memory: 348.19 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
pnpm: 9.15.0 - ~/.nvm/versions/node/v22.11.0/bin/pnpm
Browsers:
Chrome: 131.0.6778.205
Safari: 18.2
npmPackages:
vitest: 2.1.8 => 2.1.8
Used Package Manager
pnpm
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.