Skip to content

Conversation

@bxff
Copy link
Contributor

@bxff bxff commented Jan 14, 2026

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
Copy link

changeset-bot bot commented Jan 14, 2026

🦋 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

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

Labels

None yet

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

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

1 participant