ioredis-mock icon indicating copy to clipboard operation
ioredis-mock copied to clipboard

Persist data to disk

Open silverwind opened this issue 2 years ago • 1 comments

For a CLI application that use ioredis, it would be useful to have a way to persist and restore the current ioredis-mock data, so that multiple invocations of the CLI can work with a shared data set. Hypothetical API:

RedisMock.saveDump("file.json")
RedisMock.restoreDump("file.json")

silverwind avatar Aug 16 '23 16:08 silverwind

I think I'll go another route with the CLI testing and avoid the child processes, which is both faster and ioredis-mock data can persists for the lifetime of the testing process.

Leaving this open as such save/restore functionality may still be useful for other use cases.

silverwind avatar Aug 17 '23 14:08 silverwind