CodeBrowser / npm / sinon
sinon@22.0.0
// JavaScript test spies, stubs and mocks.
$ npm install sinon
downloads/wk
11,069,874
license
BSD-3-Clause
version
22.0.0
published
May 5, 2026
What is sinon?
Sinon is a testing library that provides spies, stubs, and mocks for JavaScript applications, allowing you to isolate units of code and verify their behavior during testing. Developers use it to replace real functions with test doubles, control their return values and side effects, and assert that functions were called with expected arguments. It's particularly useful for testing code that depends on external services, timers, or complex interactions between components.
Keywords
#sinon #test #testing #unit #stub #spy #fake #time #clock #mock #xhr #assert
Maintainers
fatso83, cjohansen, mantoni, mrgnrdrck