How to add "types": ["vitest/globals"]
only for test **/*.spec.ts
files
#5086
Unanswered
SeyyedKhandon
asked this question in
Q&A
Replies: 2 comments
-
This is more of a Typescript question rather than Vitest specific one. Here's discussion from Typescript: microsoft/TypeScript#37053. In summary, you can't. One of my favorite part of Vitest is that it does not pollute global typings by default like some test runners do. Importing |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently we have enabled the usage of
describe, test, it, expect
etc. in our project via:The problem is we can use
describe, expect
etc. inside non test files, and typescript wont compain about it. How can we restrict this vitest globals only to test files?ps. our test files are living next to our development files, therefore we don't have a separate
/test
folder.Beta Was this translation helpful? Give feedback.
All reactions