Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
100 lines (99 loc) · 2.67 KB
/
Copy pathvitest.config.ts
File metadata and controls
100 lines (99 loc) · 2.67 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { fileURLToPath } from "node:url"
import { defineConfig } from "vitest/config"
/**
* Root vitest config — uses projects so each app gets its own `@` alias.
* Without projects, `@/` would resolve to apps/studio/src for every test,
* including adt-runtime tests whose transitive imports use a runtime-relative
* `@/`.
*/
export default defineConfig({
test: {
projects: [
{
test: {
name: "studio",
include: [
"apps/studio/src/**/*.test.ts",
"apps/studio/src/**/*.test.tsx",
],
/**
* Route tests import their page module inside the test body; under the
* parallel load of the whole project that transform alone can exceed
* the 5s default.
*/
testTimeout: 20_000,
},
resolve: {
alias: {
"@": fileURLToPath(new URL("./apps/studio/src", import.meta.url)),
},
},
},
{
test: {
name: "adt-runtime",
include: [
"apps/adt-runtime/src/**/*.test.ts",
"apps/adt-runtime/src/**/*.test.tsx",
],
},
resolve: {
alias: {
"@": fileURLToPath(
new URL("./apps/adt-runtime/src", import.meta.url),
),
},
},
},
{
test: {
name: "api",
include: ["apps/api/src/**/*.test.ts"],
// These exercise real zip, SQLite and filesystem work; several sit near
// the 5s default and time out once the rest of the suite loads the box.
testTimeout: 20000,
},
},
{
test: {
name: "publish-service",
include: ["apps/publish-service/src/**/*.test.ts"],
exclude: ["apps/publish-service/src/**/*.integration.test.ts"],
environment: "node",
},
},
// Real workerd + D1 + R2 for the publish worker (@cloudflare/vitest-pool-workers).
"apps/publish-service/vitest.config.ts",
{
test: {
name: "desktop",
include: ["apps/desktop/src/**/*.test.ts"],
environment: "node",
},
resolve: {
alias: {
"@root": fileURLToPath(new URL(".", import.meta.url)),
},
},
},
{
test: {
name: "packages",
include: ["packages/*/src/**/__tests__/**/*.test.ts"],
},
},
{
test: {
name: "assets",
include: ["assets/adt/modules/**/*.test.js"],
},
},
{
test: {
name: "main-scripts",
include: ["scripts/**/*.test.mjs"],
},
},
],
},
})