Standalone test spies, stubs and mocks for JavaScript. Works with any unit testing framework. As before, Sinon.JS provides utilities that help test frameworks reduce the boiler-plate. As of Sinon 10 we stopped maintaining compatibility with legacy browsers. Instead, we focus on compatibility with evergreen browsers, Node.js LTS versions and recent Safari versions. The most up-to-date reference on which runtimes and browsers we support can be found by looking at our compatibility docs. Fake timers are synchronous implementations of setTimeout and friends that Sinon.JS can overwrite the global functions with to allow you to more easily test code using them. A test spy is a function that records arguments, return value, the value of this and exception thrown (if any) for all its calls. There are two types of spies: Some are anonymous functions, while others wrap methods that already exist in the system under test. Mocks should only be used for the method under test.

Features

  • General setup, fakes, spies, and stubs
  • Mocks, spy calls, promises, and fake timers
  • Fake XHR and server, JSON-P, and Assertions
  • Matchers, sandboxes, and utils
  • If you need to support old runtimes you can try Sinon 9
  • Compatibility with evergreen browsers and Node.js LTS versions

Project Samples

Project Activity

See All Activity >

License

BSD License

Follow Sinon.JS

Sinon.JS Web Site

Other Useful Business Software
One Monitoring Tool for IT, OT and Cloud | Free Trial Icon
One Monitoring Tool for IT, OT and Cloud | Free Trial

Vendor-agnostic monitoring across on-prem servers, cloud platforms and OT devices, all in one dashboard. No more tool sprawl.

Modern infrastructure spans data centers, cloud platforms and factory floors, and every blind spot between them is a risk. PRTG supports SNMP, WMI, SSH and other standard protocols to monitor IT, OT and hybrid environments through one customizable dashboard. Build the views your team needs, from network health to application performance, without switching tools. Try PRTG free for 30 days now.
Try PRTG Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Sinon.JS!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Software Testing Tool, JavaScript Frameworks, JavaScript Unit Testing Tool

Registered

2021-07-07