- Add @vitest/coverage-v8 dep so `npm run test:coverage` actually works
- Add exclude patterns to vitest config (node_modules, dist, packages)
- Replace dynamic import('vitest') in advanceTimers with direct vi import
21 lines
549 B
TypeScript
21 lines
549 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
// Enable test globals (describe, it, expect without imports)
|
|
globals: true,
|
|
env: {
|
|
CW_LOG_LEVEL: 'silent',
|
|
},
|
|
// Test file pattern
|
|
include: ['**/*.test.ts'],
|
|
exclude: ['**/node_modules/**', '**/dist/**', 'packages/**'],
|
|
// TypeScript support uses tsconfig.json automatically
|
|
// Coverage reporter (optional, for future use)
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
},
|
|
},
|
|
});
|