-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vitest.config.ts
48 lines (44 loc) · 1.51 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
/// <reference types="vitest" />
/// <reference types="vite/client" />
/// <reference types="@testing-library/jest-dom" />
import react from '@vitejs/plugin-react';
import {loadEnv} from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import {defineConfig} from 'vitest/config';
const ignoreWarnings = ['React DevTools'];
export default defineConfig(({mode}) => {
Object.assign(process.env, loadEnv(mode, process.cwd(), ''));
return {
plugins: [react(), tsconfigPaths()],
test: {
coverage: {
exclude: [
'**/node_modules/**',
'**/public/**',
'**/.{idea,git,cache,output,temp}/**',
'**/{playwright,postcss,tailwind,vite,vitest}.config.*',
'.{playwright,storybook}/**/*',
'**/.eslintrc.cjs',
'app/{languages,routes,sessions.server,state,types,validators}/**/*',
'app/{entry.client,entry.server,env.server,i18n,i18next.server,root}.*',
'app/services/api/{index,uris}.ts',
'app/services/api/**/{parsers,requests,requests.server,state,types}.*',
'app/utils/http.server.ts',
'app/**/{state,tests}/*',
'test/**/*',
],
provider: 'v8',
},
env: process.env,
environment: 'happy-dom',
globals: true,
include: ['./app/**/*.test.{ts,tsx}'],
onConsoleLog: (message) => {
if (ignoreWarnings.some((warning) => message.includes(warning))) {
return false;
}
},
setupFiles: ['./test/setup.ts'],
},
};
});