feat(ci): add coverage configuration
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
"preview": "vite preview",
|
||||
"test": "vitest",
|
||||
"test:run": "vitest run",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:integration": "vitest run tests/integration",
|
||||
"test:regression": "vitest run tests/regression --update",
|
||||
"test:e2e": "playwright test",
|
||||
|
||||
31
vitest.config.js
Normal file
31
vitest.config.js
Normal file
@@ -0,0 +1,31 @@
|
||||
import { defineConfig } from 'vitest/config'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
test: {
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
setupFiles: ['./src/test/setup.js'],
|
||||
include: ['src/**/*.{test,spec}.{js,jsx}', 'tests/**/*.{test,spec}.js'],
|
||||
exclude: ['tests/e2e/**', 'tests/performance/**', 'tests/regression/visual.test.js', 'node_modules/**'],
|
||||
snapshotFormat: {
|
||||
escapeString: true,
|
||||
printBasicPrototype: false,
|
||||
},
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'lcov', 'html'],
|
||||
exclude: [
|
||||
'node_modules/',
|
||||
'tests/',
|
||||
'**/*.test.js',
|
||||
'**/*.config.js'
|
||||
],
|
||||
lines: 80,
|
||||
functions: 80,
|
||||
branches: 80,
|
||||
statements: 80
|
||||
},
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user