Expected Behaviour
Running tests with Redis, we want to run the DB in-memory to save time and resources.
Using withCommand does not apply the commands correctly
const redis = await new RedisContainer("redis:7")
.withCommand(["redis-server", "--save", "0", "--appendonly", "no"])
.start()
Actual Behaviour
The container always runs with the default arguments:
|
this.withCommand(["redis-server", ...redisArgs]); |
Testcontainer Logs
...
Steps to Reproduce
Create a test container with arguments:
const redis = await new RedisContainer("redis:7")
.withCommand(["redis-server", "--save", "0", "--appendonly", "no"])
.start()
Log the actual arguments in the redis-container file
Environment Information
- Operating System: Pop_OS 22.04
- Docker Version: 28.4.0
- Node version: 22.18.0
- Testcontainers version: 11.5.1
Expected Behaviour
Running tests with Redis, we want to run the DB in-memory to save time and resources.
Using
withCommanddoes not apply the commands correctlyActual Behaviour
The container always runs with the default arguments:
testcontainers-node/packages/modules/redis/src/redis-container.ts
Line 51 in e5f28f8
Testcontainer Logs
...
Steps to Reproduce
Create a test container with arguments:
Log the actual arguments in the redis-container file
Environment Information