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