mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 08:52:10 +01:00
- Replace Jest imports and mocks with Vitest equivalents in setup and unit tests. - Adjust test cases to use async imports and reset modules with Vitest. - Add Vitest configuration file for test environment setup and coverage reporting.
20 lines
424 B
TypeScript
20 lines
424 B
TypeScript
// Vitest test setup
|
|
import { vi } from 'vitest';
|
|
|
|
// Mock console methods to reduce noise in tests
|
|
global.console = {
|
|
...console,
|
|
log: vi.fn(),
|
|
warn: vi.fn(),
|
|
error: vi.fn(),
|
|
};
|
|
|
|
// Set test environment variables
|
|
process.env.NEXTAUTH_SECRET = 'test-secret';
|
|
process.env.NEXTAUTH_URL = 'http://localhost:3000';
|
|
|
|
// Mock node-fetch for transcript fetcher tests
|
|
vi.mock('node-fetch', () => ({
|
|
default: vi.fn(),
|
|
}));
|