mhassan1 / redis-memory-server

Redis Server for testing. The server will allow you to connect your favorite client library to the Redis Server and run parallel integration tests isolated from each other.
MIT License
75 stars 9 forks source link

Add Redis modules #10

Closed brycelund closed 1 year ago

brycelund commented 2 years ago

I'm looking for a way to load the Redis stack modules (primarily the Redis JSON module). Is there a way this could be accomplished with the library as it is? (Perhaps through instance.args?) If not, any tips on how this would most easily be accomplished if I were to create a fork?

mhassan1 commented 2 years ago

It seems like you should be able to accomplish this using instance.args:

new RedisMemoryServer({
  instance: {
    args: ['--loadmodule', '/path/to/module/target/release/librejson.so']
  }
})

Of course, you will need to have the librejson.so file already built on the machine.