scheffin-api / src /group /group.controller.spec.ts
Rasyiq03's picture
finishing
464b662
Raw History Blame Contribute Delete
1.02 kB
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>(GroupController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});