Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
60 lines (59 loc) · 1.53 KB
/
Copy pathvitest.config.ts
File metadata and controls
60 lines (59 loc) · 1.53 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
/// <reference types="vitest" />
/// <reference types="@testing-library/jest-dom" />
/// <reference types="node" />
import { defineConfig } from "vitest/config";
import react from "@vitejs/plugin-react";
import path from "path";
import { versionDefines } from "./build-constants";
export default defineConfig({
plugins: [react()] as any,
// Mirrors vite.config.ts's version constants for code under test.
define: versionDefines,
css: {
postcss: {
plugins: [],
},
},
test: {
globals: true,
environment: "jsdom",
setupFiles: "./src/test/setup.ts",
css: true,
testTimeout: 15000,
// Vitest runs Testing-Library specs under src/; Playwright specs live
// under e2e/ and must not be picked up here (they use @playwright/test).
include: ["src/**/*.{test,spec}.{ts,tsx}"],
exclude: ["node_modules", "dist", "e2e", "playwright-report", "test-results"],
typecheck: {
include: ["src/**/*.test.{ts,tsx}"],
},
coverage: {
provider: "v8",
reporter: ["text", "json", "html"],
reportsDirectory: "./coverage",
exclude: [
"node_modules/",
"e2e/",
"src/test/",
"src/types/",
"**/types.ts",
"src/main.tsx",
"**/*.d.ts",
"**/*.config.*",
"**/mockData",
"**/*.test.{ts,tsx}",
],
thresholds: {
statements: 95,
branches: 90,
functions: 95,
lines: 95,
},
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
});