-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
50 lines (48 loc) · 1.4 KB
/
vitest.config.mjs
File metadata and controls
50 lines (48 loc) · 1.4 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
import { defineConfig } from 'vitest/config';
import { fileURLToPath } from 'node:url';
import path from 'node:path';
import react from '@vitejs/plugin-react';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: ['./vitest.setup.js'],
include: ['**/__tests__/**/*.js', '**/__tests__/**/*.mjs', '**/__tests__/**/*.jsx', '**/?(*.)+(spec|test).js', '**/?(*.)+(spec|test).mjs', '**/?(*.)+(spec|test).jsx'],
exclude: ['**/__tests__/helpers/**', '**/node_modules/**', '**/dist/**', '**/build/**'],
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html', 'lcov'],
include: ['app/**/*.{js,jsx}', 'src/**/*.{js,jsx}'],
exclude: [
'**/__tests__/**',
'**/*.test.{js,jsx,mjs}',
'**/*.spec.{js,jsx,mjs}',
'**/node_modules/**',
'**/dist/**',
'**/build/**',
'**/.next/**',
'**/coverage/**',
'app/layout.js',
'app/components/**',
'app/page.jsx',
'app/login/page.jsx',
],
all: true,
clean: true,
thresholds: {
lines: 60,
functions: 60,
branches: 60,
statements: 60
}
},
},
resolve: {
alias: {
'@': __dirname,
'server-only': path.resolve(__dirname, '__mocks__/server-only.js'),
},
},
});