Repository navigation
[vitest-plugin] Fix V8 coverage teardown with Vitest 5.0.4 - #16248
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: 25f015d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
workers-devprod
requested review from
a team and
NuroDev
and removed request for
a team
October 13, 2026 18:57
Contributor
|
Codeowners approval required for this PR:
Show detailed file reviewers |
Contributor
|
LGTM! |
@cloudflare/autoconfig
@cloudflare/build-output-utils
@cloudflare/codemods
@cloudflare/config
@cloudflare/containers-shared
create-cloudflare
@cloudflare/deploy-helpers
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-functions
@cloudflare/pages-shared
@cloudflare/runtime-types
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-plugin
@cloudflare/workers-auth
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
2 of 5 tasks
Handle __vitest_stopV8Coverage by stopping and disconnecting the existing inspector session instead of falling through to the coverage-file assertion. Extend the default-provider regression to verify coverage across sequential isolated test files, improve failure diagnostics, and add a patch changeset.
Set fsModuleCache to false in both coverage fixtures so Vitest 5.0.4 can exercise coverage independently of the filesystem-cache incompatibility. This workaround is temporary until PR #16163 is merged; remove the overrides once the cache fix is available. Validation: both coverage tests passed with Vitest 5.0.4 in the fixture processes; type-aware lint and formatting passed.
mattjohnsonpint
force-pushed
the
mjp/fix-vitest-v8-coverage
branch
from
October 13, 2026 19:07
1426627 to
12f6563
Compare
mattjohnsonpint
enabled auto-merge (squash)
October 13, 2026 19:17
2 of 5 tasks
workers-devprod
approved these changes
Oct 14, 2026
workers-devprod
left a comment
Contributor
There was a problem hiding this comment.
Codeowners reviews satisfied
NuroDev
approved these changes
Oct 14, 2026
mattjohnsonpint
disabled auto-merge
October 14, 2026 16:06
mattjohnsonpint
enabled auto-merge (squash)
October 14, 2026 16:09
edmundhung
disabled auto-merge
October 15, 2026 12:09
Merged
brandhaug
added a commit
to brandhaug/b2b-saas-starter
that referenced
this pull request
Oct 19, 2026
## pnpm-workspace.yaml (default) ## Dependency Updates | Package | From | To | Type | | --- | --- | --- | --- | | `@cloudflare/vitest-plugin` | 1.4.2 | 1.4.4 | patch | ## Release Notes <details> <summary><b>@<!---->cloudflare/vitest-plugin</b> (1.4.2 → 1.4.4) — 2 releases</summary> <details> <summary><b>1.4.4</b></summary> ### Patch Changes - Updated dependencies [[`e1d1b77`](cloudflare/workers-sdk@e1d1b77), [`e13d5cc`](cloudflare/workers-sdk@e13d5cc), [`42c6912`](cloudflare/workers-sdk@42c6912), [`4a5377f`](cloudflare/workers-sdk@4a5377f)]: - miniflare@5.20261012.1-beta - wrangler@4.151.1 </details> <details> <summary><b>1.4.3</b></summary> ### Patch Changes - [#16248](cloudflare/workers-sdk#16248) [`ad01099`](cloudflare/workers-sdk@ad01099) Thanks [@<!---->mattjohnsonpint](https://github.com/mattjohnsonpint)! - Fix V8 coverage failing with Vitest 5.0.4 Tests using V8 coverage with Vitest 5.0.4 no longer fail with an assertion error during teardown. - [#16163](cloudflare/workers-sdk#16163) [`5f12934`](cloudflare/workers-sdk@5f12934) Thanks [@<!---->edmundhung](https://github.com/edmundhung)! - Fix Workers tests failing with Vitest's filesystem module cache This supports Vitest 4.1's `test.experimental.fsModuleCache` and Vitest 5's `test.fsModuleCache`. </details> </details> --- *This PR was auto-generated by [catalog-update-action](https://github.com/brandhaug/catalog-update-action).* Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Vitest 5.0.4 introduces a
__vitest_stopV8Coveragecommand for isolated test teardown. The Workers runner does not recognize it and instead asserts that the command is__vitest_writeCoverageFile, causing V8 coverage runs to fail.Handle the new command using the existing inspector-session cleanup. Extend the V8 regression to verify coverage across sequential isolated test files, and include a patch changeset.
Both coverage fixtures temporarily set
fsModuleCache: falseto test this fix independently of the filesystem-cache incompatibility. Remove these overrides once PR #16163 is merged.Validation: