Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
61 lines (60 loc) · 2.04 KB
/
Copy pathvitest.config.ts
File metadata and controls
61 lines (60 loc) · 2.04 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
import path from 'node:path';
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.tsx'],
include: ['packages/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*',
// in-depth tests excluded based on environment variable
...(process.env.INCLUDE_IN_DEPTH !== 'true' ? ['**/in-depth/**'] : []),
],
teardownTimeout: 3000,
coverage: {
provider: 'v8',
// `html` is what gets published to Pages, `json-summary` is what the
// badge reads, and `lcov` is the portable format for anything external.
reporter: ['text', 'json', 'json-summary', 'html', 'lcov'],
reportsDirectory: './coverage',
/**
* Without these, the report is dominated by code nobody writes tests
* for: dependencies alone are more lines than the entire application,
* and they count as fully covered, which lifts the headline number by
* roughly thirty points and hides where the real gaps are.
*/
exclude: [
'**/node_modules/**',
'**/dist/**',
'**/coverage/**',
'examples/**',
'e2e/**',
'scripts/**',
'**/*.config.{ts,js,mjs}',
'**/*.test.{ts,tsx}',
'**/test-utils/**',
'packages/web/src/routeTree.gen.ts',
'packages/web/src/components/ui/**',
'vitest.setup.tsx',
],
},
server: {
deps: {
inline: ['@tanstack/react-router'],
},
},
alias: {
'@': path.resolve(__dirname),
'@web': path.resolve(__dirname, 'packages/web/src'),
'@api': path.resolve(__dirname, 'packages/api/src'),
'@shared': path.resolve(__dirname, 'packages/shared/src'),
},
},
});