-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
typecheck settings is not respected #367
Comments
Vitest shows errors on your example as unhandled source errors. To see the error alongside the test, you need your test file to match the But there is indeed a bug where Vitest extension doesn't print any unhandled errors at all. |
Type check is enabled and handled correctly in my example by vitest himself. The extension doesn't catch these error because probably it's running with its own configurations and doesn't respect the vitest config used in the workspace |
No, the extension doesn't modify your configuration, it just doesn't report them because there is no way to assign them to a test. If you read the output of Vitest in the terminal in your gif, you can see that it says "Source Errors", and not test errors. In the same gif you can see "Type Errors: no errors". |
@sheremet-va notice, not "source errors" but "Type errors", which is supported(experimentaly) in vitest. |
I know how it works, I wrote it, that's why I am explaining to you that you do not understand how it works. You are not supposed to mix runtime tests and typecheck tests. Vitest reports "source errors" because it doesn't treat your runtime test as typecheck test, but as source code. The fix doesn't change how tests are reported (it will be a green arrow), you need to update your test yourself. The fix only shows the "Source Errors" (see image) in a test result window. |
As long as your pr would fix expectTypeOf and assertType assertions on *.test-d.ts files in the vscode extension we're on the same page |
Describe the bug
typecheck settings is not respected
in the gif you can see:
npx vitest
correctly check typing.*.test-d.ts
for type tests only tests.Reproduction
first of all, awesome extension!
to reproduce:
now run
npx vitest
at root directory, or run tests from the IDE.OR small example
from vitest docs - Play Online
This extension would not correctly catch
type.test-d.ts
type errors.Output
.
Version
v0.8.6
Validations
The text was updated successfully, but these errors were encountered: