New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

redis-eval-mock

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-eval-mock

A mock version of Redis EVAL to test Lua scripts

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
101
decreased by-46.84%
Maintainers
1
Weekly downloads
 
Created
Source

redis-eval-mock

Travis CI build status codecov npm version

Provides a mock of the EVAL functionality in Redis using lua.vm.js in order to test Lua scripts. It is intended to be used along with an existing mock of the redis library, and calls back into it for Redis calls executed from Lua. In addition, it provides mocks of the cjson and cmsgpack libraries provided by default to Lua by Redis.

API

default(client)

Replaces the implementations of eval and evalsha in client with functional mocks. Returns the client. The implementation does not currently include a mock script cache, so evalsha will always throw a NOSCRIPT error.

Example

import * as redis from 'redis';
import * as mock from 'redis-mock';

import mockEval from 'redis-eval-mock';

jest.spyOn(redis, 'createClient').mockImplementation(() =>
    mockEval(mock.createClient())
);

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Keywords

FAQs

Package last updated on 02 Dec 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc