You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This can got especially complex when job handlers create other jobs inside.
The easier way of doing things would be to have drain method that suppose to process all jobs within the queue and return a promise that resolves when all jobs are processed:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description
I want to be concise in my tests related to queue.
Using
Queue#process
in tests lead to a complex code structure - similar to the one used in bull tests like here: https://github.com/OptimalBits/bull/blob/develop/test/test_queue.js#L111This can got especially complex when job handlers create other jobs inside.
The easier way of doing things would be to have
drain
method that suppose to process all jobs within the queue and return a promise that resolves when all jobs are processed:The even simpler way to write tests would be use the
#inline
method that makes all jobs processing inline:Inspired by: Sidekiq testing guide which has so much more staff to facilitate automated tests.
Are you interested in adding such functionality?
The text was updated successfully, but these errors were encountered: