Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/tiny-windows-ring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@effect/vitest": minor
---

Support vitest v4

This updates vitest in peer dependency from v3 to v4.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@
"@types/node": "^22.15.18",
"@typescript-eslint/eslint-plugin": "^8.32.1",
"@typescript-eslint/parser": "^8.32.1",
"@vitest/browser": "^3.2.4",
"@vitest/coverage-v8": "^3.2.4",
"@vitest/expect": "^3.2.4",
"@vitest/web-worker": "^3.2.4",
"@vitest/browser": "^4.0.12",
"@vitest/coverage-v8": "^4.0.12",
"@vitest/expect": "^4.0.12",
"@vitest/web-worker": "^4.0.12",
"ast-types": "^0.14.2",
"babel-plugin-annotate-pure-calls": "^0.5.0",
"eslint": "^9.26.0",
Expand All @@ -73,7 +73,7 @@
"tsx": "^4.19.4",
"typescript": "^5.8.3",
"vite": "^6.1.1",
"vitest": "^3.2.4"
"vitest": "^4.0.12"
},
"pnpm": {
"patchedDependencies": {
Expand Down
6 changes: 4 additions & 2 deletions packages/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@
"coverage": "vitest --coverage"
},
"peerDependencies": {
"@vitest/runner": "^4.0.0",
"effect": "workspace:^",
"vitest": "^3.2.0"
"vitest": "^4.0.0"
},
"devDependencies": {
"@vitest/runner": "^4.0.12",
"effect": "workspace:^",
"vitest": "^3.2.4"
"vitest": "^4.0.12"
}
}
23 changes: 3 additions & 20 deletions packages/vitest/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* @since 1.0.0
*/
import type * as VR from "@vitest/runner"
import type * as Duration from "effect/Duration"
import type * as Effect from "effect/Effect"
import type * as FC from "effect/FastCheck"
Expand All @@ -25,18 +26,10 @@ export type API =
& TestCollectorCallable

interface TestCollectorCallable<C = object> {
/**
* @deprecated Use options as the second argument instead
*/
<ExtraContext extends C>(
name: string | Function,
fn: V.TestFunction<ExtraContext>,
options: TestCollectorOptions
): void
<ExtraContext extends C>(
name: string | Function,
fn?: V.TestFunction<ExtraContext>,
options?: number | TestCollectorOptions
options?: number
): void
<ExtraContext extends C>(
name: string | Function,
Expand All @@ -45,17 +38,7 @@ interface TestCollectorCallable<C = object> {
): void
}

type TestCollectorOptions = {
concurrent?: boolean
sequential?: boolean
only?: boolean
skip?: boolean
todo?: boolean
fails?: boolean
timeout?: number
retry?: number
repeats?: number
}
type TestCollectorOptions = Omit<VR.TestOptions, "shuffle">

/**
* @since 1.0.0
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function assertInstanceOf<C extends abstract new(...args: any) => any>(
message?: string,
..._: Array<never>
): asserts value is InstanceType<C> {
// @ts-ignore
// @ts-expect-error Chai type does not allow abstract constructors
vassert.instanceOf(value, constructor, message)
}

Expand Down
7 changes: 3 additions & 4 deletions packages/vitest/tsconfig.src.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{
"extends": "../../tsconfig.base.json",
"include": ["src"],
"references": [
{ "path": "../effect/tsconfig.src.json" }
],
"references": [{ "path": "../effect/tsconfig.src.json" }],
"compilerOptions": {
"outDir": "build/src",
"tsBuildInfoFile": ".tsbuildinfo/src.tsbuildinfo",
"rootDir": "src"
"rootDir": "src",
"types": ["node"]
}
}
Loading