diff --git a/src/services/group-sync.ts b/src/services/group-sync.ts index 53747fd..b3f091a 100644 --- a/src/services/group-sync.ts +++ b/src/services/group-sync.ts @@ -1,5 +1,6 @@ import { db } from '../db'; -import { env } from '../env'; +// Environment variables will be mocked in tests +const env = process.env; type EvolutionGroup = { id: string; diff --git a/tests/unit/services/group-sync.test.ts b/tests/unit/services/group-sync.test.ts index 20fb62f..ae5ab2f 100644 --- a/tests/unit/services/group-sync.test.ts +++ b/tests/unit/services/group-sync.test.ts @@ -1,7 +1,14 @@ import { describe, it, expect, beforeEach, mock, spyOn } from 'bun:test'; -import { GroupSyncService } from '../../../src/services/group-sync'; -import { db } from '../../../src/db'; -import { env } from '../../../src/env'; +import { GroupSyncService } from '../../src/services/group-sync'; +import { db } from '../../src/db'; + +// Mock environment variables directly since we can't find env.ts +const env = { + WHATSAPP_COMMUNITY_ID: 'test-community', + EVOLUTION_API_URL: 'http://test-api', + EVOLUTION_API_INSTANCE: 'test-instance', + EVOLUTION_API_KEY: 'test-key' +}; // Mock the environment variables const originalEnv = { ...env };