forked from Effect-TS/effect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.shared.ts
66 lines (63 loc) · 1.75 KB
/
vitest.shared.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import * as path from "node:path"
import type { UserConfig } from "vitest/config"
const alias = (pkg: string) => {
const name = pkg === "effect" ? "effect" : `@effect/${pkg}`
const target = process.env.TEST_DIST !== undefined ? "dist/dist/esm" : "src"
return ({
[`${name}/test`]: path.join(__dirname, "packages", pkg, "test"),
[`${name}`]: path.join(__dirname, "packages", pkg, target)
})
}
// This is a workaround, see https://github.com/vitest-dev/vitest/issues/4744
const config: UserConfig = {
esbuild: {
target: "es2020"
},
optimizeDeps: {
exclude: ["bun:sqlite"]
},
test: {
setupFiles: [path.join(__dirname, "setupTests.ts")],
fakeTimers: {
toFake: undefined
},
sequence: {
concurrent: true
},
include: ["test/**/*.test.ts"],
alias: {
...alias("effect"),
...alias("cli"),
...alias("cluster"),
...alias("cluster-browser"),
...alias("cluster-node"),
...alias("cluster-workflow"),
...alias("experimental"),
...alias("opentelemetry"),
...alias("platform"),
...alias("platform-node"),
...alias("platform-node-shared"),
...alias("platform-bun"),
...alias("platform-browser"),
...alias("printer"),
...alias("printer-ansi"),
...alias("rpc"),
...alias("rpc-http"),
...alias("schema"),
...alias("sql"),
...alias("sql-d1"),
...alias("sql-drizzle"),
...alias("sql-kysely"),
...alias("sql-mssql"),
...alias("sql-mysql2"),
...alias("sql-pg"),
...alias("sql-sqlite-bun"),
...alias("sql-sqlite-node"),
...alias("sql-sqlite-react-native"),
...alias("sql-sqlite-wasm"),
...alias("typeclass"),
...alias("vitest")
}
}
}
export default config