Fake adapter support and bug fixes
New Features
QueueManager.fake / QueueManager.restore
You can replace all adapters with the fake adapter for test assertions, then restore the original configuration.
import { QueueManager } from '@boringnode/queue'
import { redis } from '@boringnode/queue/drivers/redis_adapter'
await QueueManager.init({
default: 'redis',
adapters: {
redis: redis({ host: 'localhost' }),
},
})
const fake = QueueManager.fake()
await SendEmailJob.dispatch({ to: 'user@example.com' })
fake.assertPushed(SendEmailJob, {
queue: 'default',
payload: { to: 'user@example.com' },
})
QueueManager.restore()Bug Fixes
Respect maxRetries: 0 in job retry configuration
Fixed a bug where maxRetries: 0 configuration was not properly respected, allowing jobs to retry when they should not. (Closes #3)