Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
77 lines (74 loc) · 2.42 KB
/
Copy pathvitest.config.ts
File metadata and controls
77 lines (74 loc) · 2.42 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
import "@akashnetwork/env-loader";
import react from "@vitejs/plugin-react";
import path from "node:path";
import { defineConfig } from "vitest/config";
const commonAlias: Record<string, string> = {
"@src": path.resolve("./src"),
"@tests": path.resolve("./tests"),
// see ./src/lib/auth0/setSession/setSession.ts for more details
"@auth0/nextjs-auth0/session": path.join(require.resolve("@auth0/nextjs-auth0"), "..", "session", "index.js"),
"@auth0/nextjs-auth0/update-session": path.join(require.resolve("@auth0/nextjs-auth0"), "..", "session", "update-session.js")
};
export default defineConfig({
test: {
outputFile: {
junit: "junit.xml"
},
coverage: {
include: ["src/**/*.{js,ts,tsx}"],
exclude: ["src/**/Editor/monaco-*.ts", "src/**/Editor/*.worker.ts", "src/queries/queryKeys.ts", "src/queries/queryKeys.ts"]
},
pool: "threads",
projects: [
{
extends: true,
plugins: [react()],
test: {
name: "unit",
environment: "jsdom",
isolate: false,
include: ["src/**/*.spec.{tsx,ts}"],
exclude: ["**/node_modules/**", "src/lib/nextjs/**", "src/lib/auth0/**", "src/pages/api/**"],
setupFiles: ["tests/unit/setup.ts"]
},
resolve: {
alias: {
...commonAlias,
"@interchain-ui/react/styles": path.resolve("./tests/unit/__mocks__/style.ts"),
"@interchain-ui/react/globalStyles": path.resolve("./tests/unit/__mocks__/style.ts"),
"@xterm/xterm/css/xterm.css": path.resolve("./tests/unit/__mocks__/style.ts"),
"@xterm/xterm": path.resolve("./tests/unit/__mocks__/xterm.ts"),
"@xterm/addon-fit": path.resolve("./tests/unit/__mocks__/xterm-addon-fit.ts")
}
}
},
{
extends: true,
test: {
name: "unit-node",
environment: "node",
include: ["src/lib/{nextjs,auth0}/**/*.spec.{tsx,ts}", "src/pages/api/**/*.spec.{tsx,ts}"],
setupFiles: ["src/lib/nextjs/setup-node-tests.ts"]
},
resolve: {
alias: {
...commonAlias
}
}
},
{
extends: true,
test: {
name: "unit-e2e-helpers",
environment: "node",
include: ["tests/ui/**/*.unit.spec.ts"]
},
resolve: {
alias: {
...commonAlias
}
}
}
]
}
});