Sinon.JS - Standalone test fakes, spies, stubs and mocks for JavaScript. Works with any unit testing framework. | Website analytics by TrustRadar
Blurry colored background
sinonjs.org JavaScript Testing Open Source

Sinon.JS - Standalone test fakes, spies, stubs and mocks for JavaScript. Works with any unit testing framework.

Standalone test spies, stubs and mocks for JavaScript. Works with any unit testing framework.

Sinon.JS is a standalone test spies, stubs and mocks for JavaScript. It works with any unit testing framework and is often used in conjunction with Mocha, Jasmine, and other testing frameworks. Sinon.JS provides tools to easily create and manage test doubles, making it easier to test JavaScript code in isolation.

Unique Visits

135K

4500 / day

Total Views

150K

5000 / day

Visit Duration, avg.

3.8 min

2.5 pages per visit

Bounce Rate

40%

  • Domain Rating

  • Domain Authority

  • Citation Level

Founded in

2010

Supported Languages

English, etc

Website Key Features

Test Spies

Functions that record arguments, return value, the value of this and exception thrown (if any) for all its calls.

Test Stubs

Functions (spies) with pre-programmed behavior. They support the full test spy API in addition to methods which can be used to alter the stub's behavior.

Mocks

Fake methods (like spies) with pre-programmed behavior (like stubs) as well as pre-programmed expectations.

Fake Timers

Provides a clock object to manipulate time, useful for testing time-dependent code.

Fake XHR and Server

Provides a fake XMLHttpRequest object and a fake server to simulate server responses.

Assertions

Comes with a set of assertions that can be used with any test spy, stub, or mock.

Sandboxing

Allows for easy creation and restoration of test doubles, ensuring tests do not affect each other.

Additional information

License

Sinon.JS is released under the BSD license.

GitHub Repository

The source code for Sinon.JS is available on GitHub, allowing for community contributions and forks.

Community and Support

Sinon.JS has a vibrant community with support available through GitHub issues, Stack Overflow, and other forums.

Documentation

Comprehensive documentation is available on the Sinon.JS website, including guides, API references, and examples.

Compatibility

Sinon.JS is compatible with all modern browsers and Node.js environments.

Contributing

Contributions to Sinon.JS are welcome, with guidelines available for submitting pull requests and reporting issues.

HTTP headers

Security headers report is a very important part of user data protection. Learn more about http headers for sinonjs.org