mirror of
https://github.com/kjanat/livedash-node.git
synced 2026-01-16 07:12:08 +01:00
feat: enhance server initialization with environment validation and import processing scheduler test: add Jest setup for unit tests and mock console methods test: implement unit tests for environment management and validation test: create unit tests for transcript fetcher functionality
26 lines
571 B
TypeScript
26 lines
571 B
TypeScript
// Jest test setup
|
|
import { jest } from '@jest/globals';
|
|
|
|
// Mock console methods to reduce noise in tests
|
|
global.console = {
|
|
...console,
|
|
log: jest.fn(),
|
|
warn: jest.fn(),
|
|
error: jest.fn(),
|
|
};
|
|
|
|
// Set test environment variables
|
|
Object.defineProperty(process.env, 'NODE_ENV', {
|
|
value: 'test',
|
|
writable: true,
|
|
configurable: true,
|
|
});
|
|
process.env.NEXTAUTH_SECRET = 'test-secret';
|
|
process.env.NEXTAUTH_URL = 'http://localhost:3000';
|
|
|
|
// Mock node-fetch for transcript fetcher tests
|
|
jest.mock('node-fetch', () => ({
|
|
__esModule: true,
|
|
default: jest.fn(),
|
|
}));
|