-
-
Notifications
You must be signed in to change notification settings - Fork 522
Open
Description
Description
@effect/vitest version 0.27.0 is incompatible with vitest 4.0 due to breaking changes in vitest's test context API.
Environment
@effect/vitest: 0.27.0vitest: 4.0.16 (incompatible) / 3.2.4 (compatible)effect: 3.19.14
Problem
When using vitest 4.0.16, all tests fail with the error:
TypeError: ctx?.onTestFinished is not a function
The error originates from @effect/vitest/dist/esm/internal/internal.js:24:
const runPromise = ctx => effect => Effect.gen(function* () {
const exitFiber = yield* Effect.fork(Effect.exit(effect));
ctx?.onTestFinished(() => Fiber.interrupt(exitFiber).pipe(Effect.asVoid, Effect.runPromise));
// ...
})Root Cause
Vitest 4.0 introduced breaking changes to the test context API. The onTestFinished method is no longer available in the test context passed to test functions, or its signature has changed.
Workaround
Downgrade to vitest 3.2.4:
{
"devDependencies": {
"vitest": "3.2.4"
}
}Expected Behavior
@effect/vitest should support vitest 4.x, or clearly document that only vitest ^3.2.0 is supported and update peer dependencies accordingly.
Request
Please update @effect/vitest to support vitest 4.0's new test context API, or provide guidance on the migration path.
References
- Vitest 4.0 breaking changes: https://github.com/vitest-dev/vitest/releases/tag/v4.0.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels