-
-
Notifications
You must be signed in to change notification settings - Fork 268
/
vitest.config.mts
70 lines (65 loc) · 2.04 KB
/
vitest.config.mts
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 tsconfigPaths from 'vite-tsconfig-paths';
import react from '@vitejs/plugin-react';
import magicalSvg from 'vite-plugin-magical-svg';
export default defineConfig({
plugins: [tsconfigPaths(), magicalSvg({ target: 'react' }), react()],
// use tsx loader for js using jsx
// TODO - remove if ever migrating to Vite
esbuild: {
loader: 'tsx',
include: /\.[jt]sx?$/,
exclude: [],
},
test: {
globals: true,
environment: 'jsdom',
include: ['./**/*.test.ts', './**/*.test.tsx', './**/*.test.js', './**/*.test.jsx'],
setupFiles: './vitest.setup.tsx',
minWorkers: 1,
maxWorkers: 2,
css: {
include: /\.module\.css$/,
modules: {
classNameStrategy: 'non-scoped',
},
},
coverage: {
reportsDirectory: './vitest-coverage',
include: [
'common/**/*.{js,ts,tsx}',
'components/**/*.{js,ts,tsx}',
'decorators/**/*.{js,ts,tsx}',
],
exclude: [
// Irrelevant configs and local-only scripts
'coverage/**',
'{cypress,vitest}-coverage/**',
'dist/**',
'.storybook-dist/**',
'.next/**',
'**/*.d.ts',
'{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,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/**',
'common/config/**',
'common/styles/**',
'common/constants/**',
// No real logic to test here
'common/utils/api-utils.{[jt]s}',
'components/ZipRecruiterJobs/ZipRecruiterJobs.{[jt]s}',
'components/Press/PressLinks/Articles.{[jt]s}',
'components/Timeline/historyData.{[jt]s}',
// Don't collect coverage from import/export mappers
'common/(.*)/index.{[jt]s}',
'components/(.*)/index.{[jt]s}',
],
},
},
});