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

chai-for-sinon

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

chai-for-sinon

It's Chai with some added assertions for Sinon.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Chai for Sinon

It's Chai with some added assertions for Sinon.

Usage

Replace require('chai') with require('chai-for-sinon').

Example:

var chai = require('chai-for-sinon'),
    expect = chai.expect;

or

Add require('chai-for-sinon') after requiring Chai.

Example:

var chai = require('chai');
require('chai-for-sinon');

Assertions

The assertions that are added.

calledOnce()

Assert that the spy/stub/mock function was called once.

Example:

expect(stub).to.be.calledOnce();

calledWith(arg1[, ...])

Assert that the spy/stub/mock function was called with the arguments passed to this function.

Example:

expect(stub).to.be.calledWith({foo: 'bar'}, 'baz');

calledWithMatch(arg1[, ...])

Assert that the spy/stub/mock function was called with arguments matching the ones passed to this function. Each argument will be wrapped in a Sinon matcher.

Example:

expect(stub).to.be.calledWithMatch({foo: 'bar'}, 'baz');

thrown()

Assert that the spy/stub/mock threw an exception when it was called.

Example:

expect(stub).to.have.thrown();

Keywords

FAQs

Package last updated on 20 Oct 2013

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