@aantonov/redis-mock 中文文档教程
redis-mock
Installation
$ [sudo] npm install --save @aantonov/redis-mock
Usage
var assert = require('assert');
var redis_client = require('@aantonov/redis-mock');
it ('Should save string value', (done) => {
var test_key = 'test_key',
test_val = 'test_val';
redis_client.set(test_key, test_val, (err) => {
if (err) return done(err);
assert.equal(redis.store[test_key], test_val);
done();
});
});
redis-mock
Installation
$ [sudo] npm install --save @aantonov/redis-mock
Usage
var assert = require('assert');
var redis_client = require('@aantonov/redis-mock');
it ('Should save string value', (done) => {
var test_key = 'test_key',
test_val = 'test_val';
redis_client.set(test_key, test_val, (err) => {
if (err) return done(err);
assert.equal(redis.store[test_key], test_val);
done();
});
});