analytics/services/processor/test/setup.ts

30 lines
693 B
TypeScript
Raw Permalink Normal View History

import 'reflect-metadata';
import { vi } from 'vitest';
// Mock TypeORM decorators to avoid metadata issues in tests
vi.mock('typeorm', async () => {
const actual = await vi.importActual<typeof import('typeorm')>('typeorm');
return {
...actual,
Entity: () => () => {},
Column: () => () => {},
PrimaryGeneratedColumn: () => () => {},
CreateDateColumn: () => () => {},
Index: () => () => {},
};
});
// Mock ioredis to avoid dependency issues in tests
vi.mock('ioredis', () => {
return {
default: vi.fn(() => ({
get: vi.fn(),
set: vi.fn(),
del: vi.fn(),
sadd: vi.fn(),
sismember: vi.fn(),
quit: vi.fn(),
})),
};
});