|
|
|
@ -1,13 +1,23 @@ |
|
|
|
|
import { BullModule, getQueueToken } from '@nestjs/bull'; |
|
|
|
|
import { Test, TestingModule } from '@nestjs/testing'; |
|
|
|
|
import { ScreenshotsController } from './screenshots.controller'; |
|
|
|
|
import { QUEUE_NAME } from './shared'; |
|
|
|
|
|
|
|
|
|
describe('ScreenshotsController', () => { |
|
|
|
|
let controller: ScreenshotsController; |
|
|
|
|
|
|
|
|
|
beforeEach(async () => { |
|
|
|
|
const module: TestingModule = await Test.createTestingModule({ |
|
|
|
|
imports: [ |
|
|
|
|
BullModule.registerQueue({ |
|
|
|
|
name: QUEUE_NAME, |
|
|
|
|
}), |
|
|
|
|
], |
|
|
|
|
controllers: [ScreenshotsController], |
|
|
|
|
}).compile(); |
|
|
|
|
}) |
|
|
|
|
.overrideProvider(getQueueToken(QUEUE_NAME)) |
|
|
|
|
.useValue({}) |
|
|
|
|
.compile(); |
|
|
|
|
|
|
|
|
|
controller = module.get<ScreenshotsController>(ScreenshotsController); |
|
|
|
|
}); |
|
|
|
|