Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

assume-sinon

Package Overview
Dependencies
Maintainers
3
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assume-sinon

Extends assume with assertions for the Sinon.JS mocking framework

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
increased by10.14%
Maintainers
3
Weekly downloads
 
Created
Source

assume-sinon

Version npmBuild StatusDependenciesCoverage Status

Extends assume with assertions against the Sinon.JS unit-test mocking framework.

The following flags are added:

  • always

The following new methods are introduced:

spylike

Assert if the value is spy.

assume(spy).is.spylike();
called

Assert that the function called x amount of times.

assume(spy).is.called(20);
calledWithNew

Assert that the function called with new.

assume(spy).is.calledWithNew();
assume(spy).is.always.calledWithNew();
calledBefore

Assert that the function called before a given sinon spy.

assume(spy).is.calledBefore(otherspy);
calledAfter

Assert that the function called after a given sinon spy.

assume(spy).is.calledAfter(otherspy);
calledOn

Assert that the function called on a given object.

assume(spy).is.calledOn(thisvalue);
calledWith

Assert that the function called with the given arguments.

assume(spy).is.calledWith('foo', 'bar');
calledMatch

Assert that the function called with matching arguments.

assume(spy).is.calledMatch('foo', 'bar');
calledWithExactly

Assert that the function called with matching arguments.

assume(spy).is.calledWithExactly('foo', 'bar');
returned

Assert that the function has returned a given value.

assume(spy).has.returned(true);
thrown

Assert that the function has thrown.

assume(spy).thrown(new Error('and error'));

License

MIT

Keywords

FAQs

Package last updated on 20 May 2016

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