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(),
    })),
  };
});
