-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathvitest.config.js
More file actions
37 lines (36 loc) · 973 Bytes
/
vitest.config.js
File metadata and controls
37 lines (36 loc) · 973 Bytes
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
import { defineConfig } from 'vitest/config';
import react from '@vitejs/plugin-react';
export default defineConfig({
plugins: [
react({
// Process all .js and .jsx files through Babel
include: [/\.[jt]sx?$/],
babel: {
presets: ['@babel/preset-flow', '@babel/preset-react'],
plugins: ['@babel/plugin-transform-flow-comments'],
},
}),
],
// Disable esbuild for JS files - let Babel handle them
esbuild: false,
test: {
environment: 'jsdom',
globals: true,
setupFiles: ['./test/setup.js'],
include: ['test/**/*.test.{js,jsx}'],
exclude: ['test/browser/**'],
// Suppress error stack traces from expected test failures
onConsoleLog: () => false,
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'lcov'],
include: ['lib/**/*.js'],
thresholds: {
lines: 70,
functions: 70,
branches: 60,
statements: 70,
},
},
},
});