6.1.0 (2022-01-28)
Features
Browser usage (Experimental)
There's a browser build available. You can import it directly (import Redis from 'ioredis-mock/browser.js'
), or use it on unpkg.com:
import Redis from 'https://unpkg.com/ioredis-mock';
const redis = new Redis();
redis.set('foo', 'bar');
console.log(await redis.get('foo'));
ioredis-mock/jest.js
is deprecated
ioredis-mock
is no longer doing a import { Command } from 'ioredis'
internally, it's now doing a direct import import Command from 'ioredis/built/command'
and thus the jest.js
workaround is no longer needed:
-jest.mock('ioredis', () => require('ioredis-mock/jest'))
+jest.mock('ioredis', () => require('ioredis-mock'))