Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.