-
-
Notifications
You must be signed in to change notification settings - Fork 268
Expand file tree
/
Copy pathvitest.config.mts
More file actions
70 lines (65 loc) · 1.96 KB
/
vitest.config.mts
File metadata and controls
70 lines (65 loc) · 1.96 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
62
63
64
65
66
67
68
69
70
/// <reference types="vitest" />
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
import magicalSvg from 'vite-plugin-magical-svg';
export default defineConfig({
plugins: [magicalSvg({ target: 'react' }), react()],
resolve: {
tsconfigPaths: true,
},
test: {
globals: true,
environment: 'jsdom',
include: [
'./src/**/*.test.ts',
'./src/**/*.test.tsx',
'./src/**/*.test.js',
'./src/**/*.test.jsx',
],
setupFiles: './vitest.setup.tsx',
maxWorkers: 2,
css: {
include: /\.module\.css$/,
modules: {
classNameStrategy: 'non-scoped',
},
},
coverage: {
reporter: ['text', 'json-summary', 'json'],
reportOnFailure: true,
reportsDirectory: './vitest-coverage',
include: [
'src/lib/**/*.{js,ts,tsx}',
'src/components/**/*.{js,ts,tsx}',
'src/decorators/**/*.{js,ts,tsx}',
],
exclude: [
// Irrelevant configs and local-only scripts
'coverage/**',
'{cypress,vitest}-coverage/**',
'dist/**',
'.next/**',
'**/*.d.ts',
'{karma,rollup,webpack,vite,vitest,jest,ava,playwright,build}.config.*',
'vitest.{workspace,projects}.[jt]s?(on)',
'.{eslint,mocha,prettier}rc.{?(c|m)js,yml}',
'scripts/**',
'test-utils/**',
// Folders covered by integration tests
'node_modules/**',
'cypress/**',
'src/lib/config/**',
'src/lib/styles/**',
'src/lib/constants/**',
// No real logic to test here
'src/lib/utils/api-utils.{[jt]s}',
'src/components/ZipRecruiterJobs/ZipRecruiterJobs.{[jt]s}',
'src/components/Press/PressLinks/Articles.{[jt]s}',
'src/components/Timeline/historyData.{[jt]s}',
// Don't collect coverage from import/export mappers
'src/lib/(.*)/index.{[jt]s}',
'src/components/(.*)/index.{[jt]s}',
],
},
},
});