Test spies, stubs and mocks for JavaScript.
Installations
npm install sinon
Developer Guide
Typescript
No
Module System
ESM, UMD
Node Version
22.2.0
NPM Version
10.7.0
Score
97.6
Supply Chain
97.1
Quality
84.7
Maintenance
100
Vulnerability
99.6
License
Releases
Make resetHistory work for props
Published on 26 Jan 2018
Speed up stub creation
Published on 23 Jan 2018
Add match.every and match.some
Published on 23 Jan 2018
Replace 4.1.5, which was a bad build
Published on 23 Jan 2018
Fix issue with `useFakeServer`
Published on 13 Jan 2018
Minor fix for Symbol names and deprecation of spy.reset
Published on 08 Jan 2018
Contributors
Unable to fetch Contributors
Languages
JavaScript (99.46%)
Shell (0.52%)
Ruby (0.02%)
Developer
Download Statistics
Total Downloads
1,438,624,479
Last Day
467,964
Last Week
4,489,487
Last Month
25,089,213
Last Year
302,255,737
GitHub Statistics
9,681 Stars
3,663 Commits
771 Forks
92 Watching
9 Branches
332 Contributors
Bundle Size
709.12 kB
Minified
242.81 kB
Minified + Gzipped
Sponsor this package
Package Meta Information
Latest Version
19.0.2
Package Id
sinon@19.0.2
Unpacked Size
5.16 MB
Size
1.36 MB
File Count
49
NPM Version
10.7.0
Node Version
22.2.0
Publised On
13 Sept 2024
Total Downloads
Cumulative downloads
Total Downloads
1,438,624,479
Last day
-56.6%
467,964
Compared to previous day
Last week
-25.7%
4,489,487
Compared to previous week
Last month
-10.8%
25,089,213
Compared to previous month
Last year
-7.2%
302,255,737
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
25
Sinon.JS
Standalone and test framework agnostic JavaScript test spies, stubs and mocks (pronounced "sigh-non", named after Sinon, the warrior).
Compatibility
For details on compatibility and browser support, please see COMPATIBILITY.md
Installation
via npm
$ npm install sinon
or via Sinon's browser builds available for download on the homepage. There are also npm based CDNs one can use.
Usage
See the sinon project homepage for documentation on usage.
If you have questions that are not covered by the documentation, you can check out the sinon
tag on Stack Overflow.
Goals
- No global pollution
- Easy to use
- Require minimal “integration”
- Easy to embed seamlessly with any testing framework
- Easily fake any interface
- Ship with ready-to-use fakes for XMLHttpRequest, timers and more
Contribute?
See CONTRIBUTING.md for details on how you can contribute to Sinon.JS
Backers
Thank you to all our backers! 🙏 [Become a backer]
Sponsors
Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]
Licence
Sinon.js was released under BSD-3
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
- Info: topLevel 'contents' permission set to 'read': .github/workflows/main.yml:12
- Info: no jobLevel write permissions found
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Warn: project license file does not contain an FSF or OSI license.
Reason
1 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
Reason
SAST tool is not run on all commits -- score normalized to 7
Details
- Warn: 12 commits out of 16 are checked with a SAST tool
Reason
3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:70: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:97: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:98: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:122: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:124: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/sinonjs/sinon/main.yml/main?enable=pin
- Warn: npmCommand not pinned by hash: docs/release-source/release/examples/run-test.sh:12
- Warn: npmCommand not pinned by hash: docs/release-source/release/examples/run-test.sh:28
- Warn: downloadThenRun not pinned by hash: .github/workflows/main.yml:92
- Info: 0 out of 12 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 1 downloadThenRun dependencies pinned
- Info: 6 out of 8 npmCommand dependencies pinned
Reason
Found 4/24 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Score
5.6
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More