-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
74 lines (73 loc) · 2.15 KB
/
vite.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
64
65
66
67
68
69
70
71
72
73
74
/// <reference types="vitest" />
/// <reference types="vite/client" />
import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite';
import checker from 'vite-plugin-checker';
import tsconfigPaths from 'vite-tsconfig-paths';
import GithubActionsReporter from 'vitest-github-actions-reporter';
export default defineConfig(({ mode }) => ({
plugins: [
react(),
...(mode === 'development'
? [
checker({
typescript: true,
eslint: {
lintCommand: 'eslint src --cache',
dev: {
logLevel: ['error']
}
},
enableBuild: false
})
]
: []),
tsconfigPaths()
],
test: {
onConsoleLog: (message: string): false | void => {
if (
message.includes(
'Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?'
)
) {
return false;
}
},
coverage: {
all: true,
branches: 100,
enabled: true,
exclude: [
'app/**/*.test.{js,ts,jsx,tsx}',
'app/*.*',
'app/**/*.config.{js,ts,jsx,tsx}',
'app/routes/*.*',
'starlight/**/*.*',
'app/**/types.ts',
'app/utils/supabase.ts',
'app/**/*.d.ts'
],
functions: 100,
include: ['app/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
lines: 100,
provider: 'v8',
reporter: ['text', 'html', 'lcov', 'clover', 'json', 'json-summary'],
reportOnFailure: true,
statements: 100,
thresholdAutoUpdate: true
},
environment: 'happy-dom',
globals: true,
include: ['./app/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
logHeapUsage: true,
outputFile: 'sonar-report.xml',
reporters: [
'vitest-sonar-reporter',
...(process.env.GITHUB_ACTIONS ? ['default', new GithubActionsReporter()] : ['default'])
],
setupFiles: ['./test/setup-test-env.ts', './test/vitest.setup.ts'],
useAtomics: true,
watchExclude: ['.*\\/node_modules\\/.*', '.*\\/build\\/.*', '.*\\/postgres-data\\/.*', '.*\\/starlight\\/.*']
}
}));