Skip to content

lttb/redis-mock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

redis-mock

This mock was implemented for testing business-logic using Redis features.
API was based on ioredis API with Promises.

Current features:

  • Pub/Sub
  • Lists: [lr]push / b?[rl]pop
  • Strings: get, set
  • Keys: del, exists, expire, pttl, ttl
  • Sets: sadd, srem, sismember
  • onevent listeners

Why?

Of course, your services must be isolated from the IO, almost always has to be an abstract wrapper. And, of course, to evaluate your system you need real Redis. But this mock allows you to easily test the application without worrying about deploying Redis, about Redis current state and storage, and it's easy to implement various breakpoints in the internal API, etc. You can fearlessly completely clean RedisMockStore for each test or share RedisMockStore for a few specific tests, forming a simple integration test for example.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published