npm ioredis-mock 3.6.0
v3.6.0

latest releases: 8.9.0, 7.5.1, 8.8.3...
6 years ago

Added

ZRANGEBYSCORE command (#350 @usebaz)

const data = {
  foo: new Map([
    ['first', { score: 1, value: 'first' }],
    ['second', { score: 2, value: 'second' }],
    ['third', { score: 3, value: 'third' }],
    ['fourth', { score: 4, value: 'fourth' }],
    ['fifth', { score: 5, value: 'fifth' }],
  ]),
};
const RedisMock = require('ioredis-mock');
const redis = new RedisMock({ data });
redis
  .zrangebyscore('foo', 1, 3)
  .then(result => console.log(result)) // logs ['first', 'second', 'third']

QUIT stub (#350 @usebaz)

In ioredis this is the equivalent to calling redis.disconnect. ioredis-mock does not implement connection simulation functionality yet so for now it's just a stub.

redis.quit() // OK

UNSUBSCRIBE stub (#350 @usebaz)

Our previous release added subscribe and joining the fray you can now pretend to be unsubscribing (just like the newsletters in your inbox!)

redis.unsubscribe() // OK

Don't miss a new ioredis-mock release

NewReleases is sending notifications on new releases.