forked from Effect-TS/effect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.workspace.ts
28 lines (24 loc) · 1.26 KB
/
vitest.workspace.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import * as path from "node:path"
import { defineWorkspace, type UserWorkspaceConfig } from "vitest/config"
// Remaining issues:
// - Random failures (browser): https://github.com/vitest-dev/vitest/issues/4497
// - Alias resolution (browser, has workaround): https://github.com/vitest-dev/vitest/issues/4744
// - Workspace optimization: https://github.com/vitest-dev/vitest/issues/4746
// TODO: Once https://github.com/vitest-dev/vitest/issues/4497 and https://github.com/vitest-dev/vitest/issues/4746
// are resolved, we can create specialized workspace groups in separate workspace files to better control test groups
// with different dependencies (e.g. playwright browser) in CI.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const project = (
config: UserWorkspaceConfig["test"] & { name: `${string}|${string}` },
root = config.root ?? path.join(__dirname, `packages/${config.name.split("|").at(0)}`)
) => ({
extends: "vitest.shared.ts",
test: { root, ...config }
})
export default defineWorkspace([
// Add specialized configuration for some packages.
// project({ name: "effect|browser", environment: "happy-dom" }),
// project({ name: "schema|browser", environment: "happy-dom" }),
// Add the default configuration for all packages.
"packages/*"
])