|
@@ -4,33 +4,18 @@ export default defineConfig({
|
|
|
test: {
|
|
test: {
|
|
|
globals: true,
|
|
globals: true,
|
|
|
environment: 'node',
|
|
environment: 'node',
|
|
|
- include: ['tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
|
|
|
|
|
|
|
+ include: ['tests/**/*.test.ts'],
|
|
|
coverage: {
|
|
coverage: {
|
|
|
provider: 'v8',
|
|
provider: 'v8',
|
|
|
reporter: ['text', 'json', 'html'],
|
|
reporter: ['text', 'json', 'html'],
|
|
|
exclude: [
|
|
exclude: [
|
|
|
- 'coverage/**',
|
|
|
|
|
- 'dist/**',
|
|
|
|
|
- '**/node_modules/**',
|
|
|
|
|
- '**/[.]**',
|
|
|
|
|
- '**/*.d.ts',
|
|
|
|
|
- '**/virtual:*',
|
|
|
|
|
- '**/__x00__*',
|
|
|
|
|
- '**/\x00*',
|
|
|
|
|
- 'cypress/**',
|
|
|
|
|
- 'test?(s)/**',
|
|
|
|
|
- 'test?(-*).?(c|m)[jt]s?(x)',
|
|
|
|
|
- '**/*{.,-}{test,spec,bench,benchmark}?(-d).?(c|m)[jt]s?(x)',
|
|
|
|
|
- '**/__tests__/**',
|
|
|
|
|
- '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
|
|
|
|
|
- '**/vitest.config.*',
|
|
|
|
|
- '**/vitest.workspace.*'
|
|
|
|
|
|
|
+ 'node_modules/',
|
|
|
|
|
+ 'dist/',
|
|
|
|
|
+ 'tests/',
|
|
|
|
|
+ '**/*.d.ts'
|
|
|
]
|
|
]
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- resolve: {
|
|
|
|
|
- alias: {
|
|
|
|
|
- '~': new URL('./src', import.meta.url).pathname
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ // 关闭并行测试以避免数据库连接冲突
|
|
|
|
|
+ fileParallelism: false
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|