A Jest preset that automatically starts an in-memory Redis server for testing using redis-memory-server. As of v0.1.0, it sets up a global Redis instance, provides process.env.REDIS_URL or global.__REDIS_URL__, and supports custom server options, shared databases across workers, and Jest watch mode. Key differentiator: seamless integration with Jest's test lifecycle, eliminating manual server setup/teardown. Release cadence: initial release, no updates since June 2019.
npm install jest-redisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures Jest to use the jest-redis preset, which starts an in-memory Redis server, and demonstrates basic Redis operations in a test using the global Redis URL.
Add 'redisGlobals' to watchPathIgnorePatterns in jest.config.js.
Use global.__REDIS_URL__ instead of process.env.REDIS_URL.
Set REDIS_MEMORY_SERVER_DOWNLOAD_DIR environment variable or binary.downloadDir to a cached location.
Either set autoStart: true or start the Redis server manually via global.__REDIS_SERVER__.start() in setupFiles.
Run: npm install --save-dev redis-memory-server (or yarn add --dev redis-memory-server)
Ensure ioredis is installed: npm install ioredis; use: const Redis = require('ioredis'); const client = new Redis(global.__REDIS_URL__);Set module.exports = { preset: 'jest-redis' }