MCPcopy Index your code
hub / github.com/sinonjs/sinon

github.com/sinonjs/sinon @v22.0.0

repository ↗ · DeepWiki ↗ · release v22.0.0 ↗ · Ask this repo → · + Follow
265 symbols 668 edges 139 files 25 documented · 9% 150 cross-repo links updated 4d agov4.2.2 · 2018-01-26★ 9,75544 open issues
README

Sinon.JS Sinon.JS

Standalone and test framework agnostic JavaScript test spies, stubs and mocks (pronounced "sigh-non", named after <a href="https://en.wikipedia.org/wiki/Sinon">Sinon, the warrior</a>).

npm version Sauce Test Status Codecov status OpenCollective OpenCollective npm downloads per month CDNJS version Contributor Covenant

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 timers

Contribute?

See CONTRIBUTING.md for details on how you can contribute to Sinon.JS. Artifact-first contract tests are used to protect public APIs during migration. The lib/ directory is generated build output and is not committed to the repository; run npm run build to regenerate it locally when needed.

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

Core symbols most depended-on inside this repo

assert
called by 631
test/distribution/browser-global-smoke.mjs
createStub
called by 330
src/sinon/stub.js
createSpy
called by 279
src/sinon/spy.js
stub
called by 224
src/sinon/stub.js
spy
called by 184
src/sinon/spy.js
red
called by 54
src/sinon/colorizer.js
createSandbox
called by 45
src/sinon/create-sandbox.js
wrapMethod
called by 35
src/sinon/util/core/wrap-method.js

Shape

Function 239
Class 14
Method 12

Languages

TypeScript100%

Modules by API surface

test/issues/issues-test.js25 symbols
test/src/sandbox-test.js16 symbols
test/src/stub-test.js14 symbols
test/src/spy-test.js14 symbols
src/sinon/sandbox.js12 symbols
test/src/proxy-call-test.js10 symbols
test/src/fake-timers-test.js10 symbols
src/sinon/colorizer.js10 symbols
src/sinon/util/core/wrap-method.js9 symbols
src/sinon/stub.js8 symbols
src/sinon/assert.js7 symbols
docs/assets/js/prism.js7 symbols

Dependencies from manifests, versioned

@fatso83/mini-mochalatest · 1×
@mochify/cli1.0.0 · 1×
@mochify/driver-puppeteer1.0.1 · 1×
@mochify/driver-webdriver1.0.0 · 1×
@rollup/plugin-commonjs29.0.2 · 1×
@rollup/plugin-json6.1.0 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@sinonjs/commons3.0.1 · 1×
@sinonjs/eslint-plugin-no-prototype-methods0.1.1 · 1×
@sinonjs/fake-timers15.4.0 · 1×
@sinonjs/referee11.0.2 · 1×

For agents

$ claude mcp add sinon \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact