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
what are the best practices for using vitest with a monorepo? I've tried really hard to have one vite.config file for both node and react tests and I just can't get it right.
one problem is having to specify a single environment for the whole project - node or DOM. in one set of tests I will always have to put the // @vitest-environment jsdom guys which feels not ideal.
another is threading - it causes segfaults pretty consistently with my prisma integration tests, but if i don't have it enabled for DOM tests then they seem to be not isolated and end up having a dirty DOM between tests.
the test setup has a bunch of hacky stuff i found on github issues for things like mocked canvas. would be ideal to have setup files by environment or something.
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.
-
what are the best practices for using vitest with a monorepo? I've tried really hard to have one vite.config file for both node and react tests and I just can't get it right.
one problem is having to specify a single environment for the whole project - node or DOM. in one set of tests I will always have to put the // @vitest-environment jsdom guys which feels not ideal.
another is threading - it causes segfaults pretty consistently with my prisma integration tests, but if i don't have it enabled for DOM tests then they seem to be not isolated and end up having a dirty DOM between tests.
the test setup has a bunch of hacky stuff i found on github issues for things like mocked canvas. would be ideal to have setup files by environment or something.
Beta Was this translation helpful? Give feedback.
All reactions