-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
63 lines (52 loc) · 1.71 KB
/
vitest.config.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
// ./vitest.config.ts
//
// Repo-scoped configuration for vitest.
// Vitest essential imports.
import tsconfigPaths from "vite-tsconfig-paths";
import { coverageConfigDefaults, defineConfig } from "vitest/config";
// Custom Vitest config definition.
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
// Specify the test environment to be node, as backend is a node server.
environment: "node",
// Setup files to run before all tests.
setupFiles: ["vitest.setup.ts"],
// Global test match pattern.
include: ["src/**/*.test.ts", "scripts/**/*.test.ts"],
alias:
// biome-ignore format: added alignment for better readability.
{
"@src/" : new URL("./src/", import.meta.url).pathname,
"@data/" : new URL("./data/", import.meta.url).pathname,
"@utils/": new URL("./src/utils/", import.meta.url).pathname,
},
// Configure coverage and reporters.
coverage: {
// Specify reporing coverage for the project src directory.
include: ["src"],
// Files to be ignored for coverage.
exclude: [
"src/researchPostings/fetchUndergradResearchPostingsOnPageNum.ts",
"src/researchPostings/fetchUndergradResearchPostings.ts",
...coverageConfigDefaults.exclude,
],
// Coverage thresholds for the project.
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
// Vitest typecheck config, run with `vitest typecheck`.
typecheck: {
enabled: true,
tsconfig: "tsconfig.json",
},
// Vitest benchmark config, run with `vitest benchmark`.
benchmark: {
reporters: ["default", "verbose"],
},
},
});