test: migrate from Jest to Vitest (Phase 1 complete)
- Remove Jest and all related packages - Install Vitest with coverage support - Create vitest.config.ts with path aliases - Set up global test configuration - Migrate all 6 test files to Vitest syntax - Update TypeScript configuration for better Vitest support - Create separate tsconfig.build.json for clean builds - Fix all import/module issues in tests - All 68 tests passing successfully - Current coverage baseline: 2.45% Phase 1 of testing suite improvement complete. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
26
tests/setup/global-setup.ts
Normal file
26
tests/setup/global-setup.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { beforeEach, afterEach, vi } from 'vitest';
|
||||
|
||||
// Reset mocks between tests
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
// Clean up after each test
|
||||
afterEach(() => {
|
||||
vi.restoreAllMocks();
|
||||
});
|
||||
|
||||
// Global test timeout
|
||||
vi.setConfig({ testTimeout: 10000 });
|
||||
|
||||
// Silence console during tests unless DEBUG=true
|
||||
if (process.env.DEBUG !== 'true') {
|
||||
global.console = {
|
||||
...console,
|
||||
log: vi.fn(),
|
||||
debug: vi.fn(),
|
||||
info: vi.fn(),
|
||||
warn: vi.fn(),
|
||||
error: vi.fn(),
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user