Skip to content

Commit

Permalink
test(bull-explorer): fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony133 committed Dec 15, 2020
1 parent 352e136 commit bfdda41
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/test/bull.explorer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { InstanceWrapper } from '@nestjs/core/injector/instance-wrapper';
import { Test } from '@nestjs/testing';
import { BullExplorer } from '../bull.explorer';
import { BullModule } from '../bull.module';
Expand Down Expand Up @@ -96,8 +97,15 @@ describe('bullExplorer', () => {
const instance = { handler: jest.fn() };
const queue = { on: jest.fn() } as any;
const opts = { eventName: 'test' } as any;
const wrapper = InstanceWrapper;

bullExplorer.handleListener(instance, 'handler', queue, opts);
bullExplorer.handleListener(
instance,
'handler',
new wrapper(),
queue,
opts,
);
expect(queue.on).toHaveBeenCalledWith(
opts.eventName,
expect.any(Function),
Expand Down

0 comments on commit bfdda41

Please sign in to comment.