test: add Wave 1 infrastructure (types, mocks, vitest config) + User/Order/Material factories

- tests/fixtures/types.ts: Test fixture type definitions
- tests/fixtures/factory.ts: User/Order/Material factories
- tests/mocks/types.ts: Mock type definitions (549 lines)
- tests/mocks/index.ts: Mock factory functions
- vitest.config.ts: Performance optimizations (isolate:false, pool:threads)
- User/Order/Material factory tests (7 tests total)

Performance: 7.65s → 4.94s (35% improvement)
This commit is contained in:
Misaka
2026-04-04 20:15:54 +08:00
parent 2e102d8ab3
commit fb3dd43164
7 changed files with 1405 additions and 0 deletions

View File

@@ -11,6 +11,11 @@ export default defineConfig({
env: {
NODE_ENV: 'test'
},
// 性能优化配置
isolate: false, // 禁用隔离(提升 30-50% 速度)
pool: 'threads', // 使用线程池
maxWorkers: 4,
bail: process.env.CI ? 1 : undefined,
coverage: {
provider: 'v8',
reporter: ['text', 'json', 'html']