Skip to content

Commit

Permalink
updated vitest to v3 (#4376)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Lorenz <fubhy@fubhy.com>
  • Loading branch information
f15u and fubhy authored Feb 16, 2025
1 parent ba60870 commit aa39549
Show file tree
Hide file tree
Showing 7 changed files with 462 additions and 784 deletions.
5 changes: 5 additions & 0 deletions .changeset/tidy-falcons-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/vitest": minor
---

updated `vitest` to `3.0`
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
"@types/node": "^22.13.4",
"@typescript-eslint/eslint-plugin": "^7.16.0",
"@typescript-eslint/parser": "^7.16.0",
"@vitest/browser": "^2.1.4",
"@vitest/coverage-v8": "^2.1.4",
"@vitest/expect": "^2.1.4",
"@vitest/web-worker": "^2.1.4",
"@vitest/browser": "^3.0.3",
"@vitest/coverage-v8": "^3.0.3",
"@vitest/expect": "^3.0.3",
"@vitest/web-worker": "^3.0.3",
"ast-types": "^0.14.2",
"babel-plugin-annotate-pure-calls": "^0.5.0",
"eslint": "^9.9.1",
Expand All @@ -73,14 +73,13 @@
"rimraf": "^6.0.1",
"tsx": "^4.17.0",
"typescript": "^5.7.2",
"vite": "^5.4.0",
"vitest": "^2.1.4"
"vite": "^6.0.11",
"vitest": "^3.0.5"
},
"pnpm": {
"patchedDependencies": {
"@changesets/get-github-info@0.6.0": "patches/@changesets__get-github-info@0.6.0.patch",
"@changesets/assemble-release-plan@6.0.3": "patches/@changesets__assemble-release-plan@6.0.3.patch",
"vitest-websocket-mock": "patches/vitest-websocket-mock.patch"
"@changesets/assemble-release-plan@6.0.3": "patches/@changesets__assemble-release-plan@6.0.3.patch"
},
"ignoredBuiltDependencies": [
"cpu-features",
Expand Down
4 changes: 2 additions & 2 deletions packages/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
},
"peerDependencies": {
"effect": "workspace:^",
"vitest": "^2.0.5"
"vitest": "^3.0.0"
},
"devDependencies": {
"effect": "workspace:^",
"vitest": "^2.1.4"
"vitest": "^3.0.5"
}
}
6 changes: 3 additions & 3 deletions packages/vitest/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export namespace Vitest {
export interface Test<R> {
<A, E>(
name: string,
self: TestFunction<A, E, R, [V.TaskContext<V.RunnerTestCase<{}>> & V.TestContext]>,
self: TestFunction<A, E, R, [V.TestContext]>,
timeout?: number | V.TestOptions
): void
}
Expand Down Expand Up @@ -75,7 +75,7 @@ export namespace Vitest {
R,
[
{ [K in keyof Arbs]: Arbs[K] extends FC.Arbitrary<infer T> ? T : Schema.Schema.Type<Arbs[K]> },
V.TaskContext<V.RunnerTestCase<{}>> & V.TestContext
V.TestContext
]
>,
timeout?:
Expand Down Expand Up @@ -113,7 +113,7 @@ export namespace Vitest {
arbitraries: Arbs,
self: (
properties: { [K in keyof Arbs]: Arbs[K] extends FC.Arbitrary<infer T> ? T : Schema.Schema.Type<Arbs[K]> },
ctx: V.TaskContext<V.RunnerTestCase<{}>> & V.TestContext
ctx: V.TestContext
) => void,
timeout?:
| number
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const makeTester = <R>(
it: V.TestAPI = V.it
): Vitest.Vitest.Tester<R> => {
const run = <A, E, TestArgs extends Array<unknown>>(
ctx: V.TaskContext<V.RunnerTestCase<object>> & V.TestContext & object,
ctx: V.TestContext & object,
args: TestArgs,
self: Vitest.Vitest.TestFunction<A, E, R, TestArgs>
) => pipe(Effect.suspend(() => self(...args)), mapEffect, runTest(ctx))
Expand Down
13 changes: 0 additions & 13 deletions patches/vitest-websocket-mock.patch

This file was deleted.

Loading

0 comments on commit aa39549

Please sign in to comment.