Peekaboo/tests/setup.ts
Peter Steinberger 670e1c485a Add GitHub Actions CI workflow for Node.js builds
- Configure CI to run on macOS-latest
- Test with Node.js 20.x and 22.x
- Run npm build and tests on push/PR

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-05-25 01:25:35 +02:00

37 lines
No EOL
787 B
TypeScript

// Jest setup file
// Configure global test environment
// Mock console methods to reduce noise during testing
const originalConsole = global.console;
beforeEach(() => {
// Reset console mocks before each test
global.console = {
...originalConsole,
log: jest.fn(),
error: jest.fn(),
warn: jest.fn(),
info: jest.fn(),
debug: jest.fn(),
};
});
afterEach(() => {
// Restore original console after each test
global.console = originalConsole;
jest.clearAllMocks();
});
// Global test timeout
jest.setTimeout(10000);
// Mock environment variables for testing
process.env.NODE_ENV = 'test';
process.env.PEEKABOO_AI_PROVIDERS = JSON.stringify([
{
type: 'ollama',
baseUrl: 'http://localhost:11434',
model: 'llava',
enabled: true
}
]);