You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've started new React project using vite and react-ts template. Now came the time to write unit tests, and I am a bit stumped, how to correctly set up vitest on this template? Main source of confusion is that template provides three tsconfig files: tsconfig.json, tsconfig.app.json and tsconfig.node.json. Following tutorial for vitest it seems that all settings should end up in tsconfig.json file, but that does not feel right. During research I stumbled upon article explaining why different tsconfig files are used and at the end I think I should add third config file - tsconfig.test.json. Could someone explain a little better, what is the best solution to integrate vitest in react-ts template? I am writing to vite project discussions, opposed to vitest, because that's where I got the initial react-ts template. Maybe authors have a few tips on unit test integration?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've started new React project using vite and react-ts template. Now came the time to write unit tests, and I am a bit stumped, how to correctly set up vitest on this template? Main source of confusion is that template provides three tsconfig files: tsconfig.json, tsconfig.app.json and tsconfig.node.json. Following tutorial for vitest it seems that all settings should end up in tsconfig.json file, but that does not feel right. During research I stumbled upon article explaining why different tsconfig files are used and at the end I think I should add third config file - tsconfig.test.json. Could someone explain a little better, what is the best solution to integrate vitest in react-ts template? I am writing to vite project discussions, opposed to vitest, because that's where I got the initial react-ts template. Maybe authors have a few tips on unit test integration?
Beta Was this translation helpful? Give feedback.
All reactions