A mock of Redis EVAL functionality for testing Lua scripts in Node.js. Version 1.0.1, last updated in 2019, with no active development. It integrates with existing redis mocks like redis-mock and provides mock implementations of cjson and cmsgpack libraries. It allows testing Lua scripts without a real Redis server, but note that evalsha always throws NOSCRIPT as there is no script cache. The package ships TypeScript types and has a peer dependency on @types/redis. It is a niche testing utility, not updated recently.
npm install redis-eval-mockNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a mocked Redis client with eval support for testing Lua scripts in Node.js.
If you need to test evalsha, you will need to extend the mock or use a different library.
Consider testing with a real Redis instance or using alternatives like ioredis-mock.
Install @types/redis as a dev dependency.
Use import syntax instead of require().
Use `import mockEval from 'redis-eval-mock'` (without curly braces).
Run `npm install --save-dev @types/redis`.
If you need to test evalsha, consider using a different mocking strategy or a real Redis server.