testing-nestjs icon indicating copy to clipboard operation
testing-nestjs copied to clipboard

[NEW TEST] Bull

Open robertsLando opened this issue 4 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Feature Test To Be Requested

Add some examples using nestjs bull queue

robertsLando avatar Apr 11 '22 15:04 robertsLando

What would you like this bull test to show? Unit testing for a queue? E2E tests using a queue? Both?

jmcdo29 avatar Apr 11 '22 15:04 jmcdo29

Both

robertsLando avatar Apr 11 '22 15:04 robertsLando

I'll see how soon I can work on this

jmcdo29 avatar Apr 11 '22 16:04 jmcdo29

@jmcdo29 Thanks! ATM the only resource I found about bull testing is https://stackoverflow.com/questions/68214492/how-can-a-nest-bull-queue-be-tested-via-jest-di-via-injectqueue

But It's not working for me, queue is always undefined inside the service when using

@InjectQueue('test') queue: Queue

UPDATE: That example is actually working, the problem was that my mock implementation wasn't correct

robertsLando avatar Apr 11 '22 16:04 robertsLando