bullmq icon indicating copy to clipboard operation
bullmq copied to clipboard

Is there a way to run BullMQ solely in memory for integration testing?

Open sstano opened this issue 5 months ago • 1 comments

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!

sstano avatar Jul 23 '25 20:07 sstano

Maybe not exactly what you're looking for, but we've been using redis-memory-server to great success

jgchk avatar Jul 29 '25 14:07 jgchk