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
HMR is injected into the code for non-production builds which totally breaks code coverage during tests.
It took me a long time to find that it can be disabled in vitest.config.ts using:
tanstackRouter({// Disable HMR injection in test builds. The code-splitter plugin injects// import.meta.hot accept blocks into route files for dev-time hot reloading.// These create untestable branches that inflate coverage gaps.codeSplittingOptions: {addHmr: false},}),
I don't suppose there is any way to automatically disable this during tests? At the very least could this be added to the documentation?
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.
-
HMR is injected into the code for non-production builds which totally breaks code coverage during tests.
It took me a long time to find that it can be disabled in
vitest.config.tsusing:I don't suppose there is any way to automatically disable this during tests? At the very least could this be added to the documentation?
Beta Was this translation helpful? Give feedback.
All reactions