Miniredis is a pure Go Redis server implementation for use in unit tests.
The tool solves the problem of testing Redis-dependent code without requiring a full integration test setup or external Redis binaries. It implements a substantial portion of the Redis command set and provides a real TCP interface, allowing tests to interact with it as they would with an actual Redis server. Because the server runs in-process within the test, you can directly query values without routing through the server stack, and there are no external dependencies to manage in build pipelines.
Miniredis suits projects where you need to verify Redis interactions in unit tests but want to avoid the overhead of spinning up a real Redis instance. It works well for testing application logic that depends on Redis without converting those tests into integration tests. The tool implements most common Redis commands across strings, hashes, lists, sets, sorted sets, streams, pub/sub, transactions, and scripting, though some commands are only partially implemented. If your code uses Redis features outside this command set, you would need to verify coverage against the documented list before adopting it.
The project maintains a steady stream of commits addressing bug fixes and command implementations, with pull requests regularly merged to expand Redis compatibility. Development activity shows consistent attention to keeping the tool aligned with Redis behavior, including handling of edge cases in command implementations and TTL semantics specific to testing scenarios.