How to enable vitest strict type checking on function arguments whose type is a union of string literals #2719
Replies: 1 comment 1 reply
-
Can you provide some more details on your setup. How do you run the type checker when testing? |
Beta Was this translation helpful? Give feedback.
-
The Pinia store below defines the
turn
function which takes a union of string literals as its parameter.When 'turn' is invoked outside a test environment with a wrong argument, the TS compiler correctly indicates the issue:
But when invoked with a wrong argument in a test environment, the TS compiler does not flag it as an error.
How do I enable stricter type checking inside vitest test environment?
Beta Was this translation helpful? Give feedback.
All reactions