import { Test, TestingModule } from '@nestjs/testing'; import { GroupController } from './group.controller'; import { WhatsappService } from '../whatsapp/whatsapp.service'; jest.mock('@whiskeysockets/baileys', () => ({ __esModule: true, default: jest.fn(), useMultiFileAuthState: jest.fn(() => Promise.resolve({ state: {}, saveCreds: jest.fn() })), Browsers: { macOS: jest.fn() }, })); jest.mock('@hapi/boom'); jest.mock('qrcode-terminal'); describe('GroupController', () => { let controller: GroupController; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ controllers: [GroupController], providers: [ { provide: WhatsappService, useValue: { getSocket: jest.fn(), getAllGroupsCache: jest.fn(), }, }, ], }).compile(); controller = module.get(GroupController); }); it('should be defined', () => { expect(controller).toBeDefined(); }); });