-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
40 lines (38 loc) · 1.19 KB
/
Copy pathvitest.config.ts
File metadata and controls
40 lines (38 loc) · 1.19 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
import path from "path";
import { loadEnv } from "vite";
import { defineConfig } from "vitest/config";
import CustomReporter from "./reporter";
export default ({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd()) };
const shouldLogOnSuccess = process.env.VITE_ENV === "DEV";
return defineConfig({
resolve: {
alias: {
"@/client": path.resolve(__dirname, "./src/client"),
"@/shared": path.resolve(__dirname, "./src/shared"),
"@/endpoints": path.resolve(__dirname, "./src/endpoints"),
"@/test": path.resolve(__dirname, "./src/test"),
},
},
// plugins: [tsConfigPaths()],
test: {
reporters: [new CustomReporter(shouldLogOnSuccess)],
fileParallelism: false,
maxConcurrency: 1,
testTimeout: 20000,
retry: 1,
isolate: false,
coverage: {
reporter: ["json", "json-summary", "text", "html"],
reportOnFailure: true,
exclude: ["non_npm_dependencies", "node_modules", "src/test", "*.*js", "src/index.ts", "dist", "*.ts"],
thresholds: {
lines: 80,
branches: 80,
functions: 80,
statements: 80
}
}
},
});
};