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.0
vitest: 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
Description
@effect/vitestversion 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.14Problem
When using vitest 4.0.16, all tests fail with the error:
The error originates from
@effect/vitest/dist/esm/internal/internal.js:24:Root Cause
Vitest 4.0 introduced breaking changes to the test context API. The
onTestFinishedmethod 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/vitestshould support vitest 4.x, or clearly document that only vitest ^3.2.0 is supported and update peer dependencies accordingly.Request
Please update
@effect/vitestto support vitest 4.0's new test context API, or provide guidance on the migration path.References