Skip to content

fix: update HMR condition to exclude test mode - #307

Open
Jungzl wants to merge 1 commit into
solidjs:mainfrom
Jungzl:fix/test
Open

fix: update HMR condition to exclude test mode#307
Jungzl wants to merge 1 commit into
solidjs:mainfrom
Jungzl:fix/test

Conversation

@Jungzl

@Jungzl Jungzl commented Aug 13, 2026

Copy link
Copy Markdown

Disable HMR injection in test mode.

This plugin previously injected solid-refresh HMR code into every transformed module when running vitest. The injected if (import.meta.hot) branch does not exist in the source, which made coverage reports (e.g. vitest run --coverage) show branches/lines that do not match the source.

Although we can pass { hot: false } to escape the situation, it's better to bypass all test scenarios by default.

Test mode now skips HMR injection so coverage mappings align with the source.

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 784ceef

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant