@aantonov/redis-mock

Redis mock for tests

Usage no npm install needed!

<script type="module">
  import aantonovRedisMock from 'https://cdn.skypack.dev/@aantonov/redis-mock';
</script>

README

redis-mock

NPM version Build Status Coverage Status

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();
        });
    });