Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
chai-for-sinon
Advanced tools
It's Chai with some added assertions for Sinon.
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');
The assertions that are added.
Assert that the spy/stub/mock function was called once.
Example:
expect(stub).to.be.calledOnce();
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');
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');
Assert that the spy/stub/mock threw an exception when it was called.
Example:
expect(stub).to.have.thrown();
FAQs
It's Chai with some added assertions for Sinon.
The npm package chai-for-sinon receives a total of 0 weekly downloads. As such, chai-for-sinon popularity was classified as not popular.
We found that chai-for-sinon demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.