Skip to content

fix(@effect/vitest): fix compatibility with Vitest 4.0 (#5976)#5980

Open
bxff wants to merge 2 commits into
Effect-TS:v3from
bxff:main
Open

fix(@effect/vitest): fix compatibility with Vitest 4.0 (#5976)#5980
bxff wants to merge 2 commits into
Effect-TS:v3from
bxff:main

Conversation

@bxff

@bxff bxff commented Jan 14, 2026

Copy link
Copy Markdown
Contributor

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

This PR fixes an incompatibility with Vitest 4.0 in @effect/vitest.

Vitest 4.0 has removed (or changed) the onTestFinished method on the test context object, causing a TypeError: ctx?.onTestFinished is not a function.

The fix switches to using the top-level onTestFinished hook imported directly from vitest. This is the recommended approach in modern Vitest versions and is fully backward compatible with the current peer dependency (vitest: ^3.2.0), as this export has been available since Vitest 0.34.0.

Additionally, @effect/vitest's peerDependencies have been updated to explicitly support Vitest 4.x.

Related

@bxff
bxff requested a review from mikearnaldi as a code owner January 14, 2026 06:05
@github-project-automation github-project-automation Bot moved this to Discussion Ongoing in PR Backlog Jan 14, 2026
@changeset-bot

changeset-bot Bot commented Jan 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ecafb0d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@effect/vitest Patch

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

@bxff

bxff commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

@mikearnaldi friendly bump

@akadop

akadop commented Apr 15, 2026

Copy link
Copy Markdown

friendly bump

@ncaq

ncaq commented Jun 2, 2026

Copy link
Copy Markdown

vitest is vulnerability.
When Vitest UI server is listening, arbitrary file can be read and executed · CVE-2026-47429 · GitHub Advisory Database
Please merge it PR.

@IMax153
IMax153 changed the base branch from main to v3 July 13, 2026 23:56
@IMax153 IMax153 added the 3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3. label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.0 Used for issues, pull requests, etc. that are relevant for the `v3` branch targeting Effect v3.

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

@effect/vitest: Incompatibility with vitest 4.0 - onTestFinished API change

4 participants