bullmq
bullmq copied to clipboard
Is there a way to run BullMQ solely in memory for integration testing?
Is your feature request related to a problem? Please describe. I'm trying to write an integration test that would run also on CI without any external dependencies (Redis).
Describe the solution you'd like Ideally something like:
// For production:
BullModule.forRoot({
connection: {
host: config.host,
port: config.port,
},
prefix: config.prefix || '',
});
// For integration tests:
BullModule.forRoot({
inMemory: true,
prefix: config.prefix || '',
});
Describe alternatives you've considered
- spin up a test Redis and configure the test job to point to it
- mock BullMQ with custom logic that simulates BullMQ (resulting in incomplete E2E testing)
- ... any better suggestions appreciated!
Maybe not exactly what you're looking for, but we've been using redis-memory-server to great success