
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
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 1 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.