Spaces:
Paused
Paused
Download src/group/group.controller.spec.ts from Rasyiq03/scheffin-api: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/Rasyiq03/scheffin-api/resolve/main/src/group/group.controller.spec.ts
- Command line
-
hf download hf://spaces/Rasyiq03/scheffin-api/src/group/group.controller.spec.ts
-
curl -L -o group.controller.spec.ts https://huggingface.co/spaces/Rasyiq03/scheffin-api/resolve/main/src/group/group.controller.spec.ts
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(); | |
| }); | |
| }); | |