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

candy-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

candy-wrapper

A sinon.js-like wrapper for functions that creates stubs, spys, mocks, etc.

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-83.33%
Maintainers
1
Weekly downloads
 
Created
Source

Work in progress. Please don't use.

Build Status Coverage Status

This library is similar to the wonderful Sinon and can be used for creating stubs, spys, and mocks for testing. The API has been re-invented to be consistent and re-use code across all those functionalities.

The primary interfaces are Wrapper, Expect, Trigger, and Action.

  • Wrappers wrap a function or attribute, so that when the Wrapper is called, so is the underlying function or attribute.
  • You can use Expect to examine what happened with a Wrapper, such as seeing what args were passed to it or what the return value was.
  • Triggers get called just before or just after a function call, providing the opportunity validate Expects or perform Actions.
  • Actions can do things like change arguments recieved by the wrapped function or change the value returned to the caller.

Keywords

FAQs

Package last updated on 18 Mar 2017

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