Switch extractor-workflow e2e test from vitest to Playwright test runner for consistency with playwright.config.ts. Remove redundant unit tests (cleaner, erp-auth, extractor) that have been superseded by more thorough replacements under tests/unit/services/erp/. Enable test isolation unconditionally to prevent cross-file state pollution. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
52 lines
1.3 KiB
TypeScript
52 lines
1.3 KiB
TypeScript
import { defineConfig } from 'vitest/config'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: true,
|
|
environment: 'node',
|
|
include: ['tests/**/*.{test,spec}.{ts,tsx}'],
|
|
exclude: ['node_modules', 'dist', 'out', 'tests/e2e', 'tests/integration'],
|
|
setupFiles: ['tests/setup.ts'],
|
|
env: {
|
|
NODE_ENV: 'test'
|
|
},
|
|
isolate: true,
|
|
pool: 'threads', // 使用线程池
|
|
maxWorkers: 4,
|
|
bail: process.env.CI ? 1 : undefined,
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html', 'lcov'],
|
|
thresholds: {
|
|
global: {
|
|
branches: 60,
|
|
functions: 70,
|
|
lines: 70,
|
|
statements: 70
|
|
},
|
|
'src/main/services/erp/**': {
|
|
branches: 70,
|
|
functions: 80,
|
|
lines: 80,
|
|
statements: 80
|
|
},
|
|
'src/main/services/update/**': {
|
|
branches: 70,
|
|
functions: 80,
|
|
lines: 80,
|
|
statements: 80
|
|
}
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@main': path.resolve(__dirname, './src/main'),
|
|
'@services': path.resolve(__dirname, './src/main/services'),
|
|
'@types': path.resolve(__dirname, './src/main/types'),
|
|
'@': path.resolve(__dirname, './src')
|
|
}
|
|
}
|
|
})
|