forked from Effect-TS/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.shared.ts
More file actions
35 lines (32 loc) · 829 Bytes
/
vitest.shared.ts
File metadata and controls
35 lines (32 loc) · 829 Bytes
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
import * as path from "node:path"
import type { UserConfig } from "vitest/config"
const alias = (name: string) => {
const target = process.env.TEST_DIST !== undefined ? "dist/dist/esm" : "src"
return ({
[`${name}/test`]: path.join(__dirname, "packages", name, "test"),
[`${name}`]: path.join(__dirname, "packages", name, 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("create-effect-app")
}
}
}
export default config