NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2830 most downloaded on npm
JavaScript test spies, stubs and mocks.
Last release 2 months ago
20 Jul 2026
Release timing varies
gaps range from 2 weeks to 6 months
Nearly every release is documented
notes for 21 of 22 stable releases
199 versions withdrawn
withdrawn after publishing
16 years old
221 releases · first in 2010
Nothing published for this version
Fixed bug where assertions don't handle functions that have a property named proxy
npm docs sinon work.files in package.jsonprogress, load and readystatechange in the readyStateChange function in FakeXMLHttpRequest are dispatched in a different order in comparison to a browser. Reorder the events dispatched to reflect general browser behaviour.One column per quarter.
Fallback for .restore() native code functions on Chrome & PhantomJS (なつき)
Stub & spy getters & setters (Simon Zack)
fix @depends-require mismatches (fixes AMD issues) (Ben Hockey)
Nothing published for this version
- Fixed lolex issue on node
Fake timers are now extracted as lolex: http://github.com/sinonjs/lolex
Expose match on returned sandbox (Duncan Beevers)
Don't call sinon.expectation.pass if there aren't any expectations (Jeffrey Falgout)
Fix loading in Web Workers (Victor Costan)
Fix returnValue and exception regression on spy calls (Maximilian Antoni)
returnValue and exception regression on spy calls (Maximilian Antoni)Improved mocha compatibility for async tests (Ming Liu)
Ensure that spy createCallProperties is set before function invocation (James Barwell)
Fix an issue passing NaN to calledWith (Blake Israel)
NaN to calledWith (Blake Israel)ref and unref properties on Node (Ben Fleis)Add sinon.assert.match (Robin Pedersen)
Fixes an edge case with calledWithNew and spied native functions, and other functions that lack a .prototype
Screwed up NPM release of 1.8.0, unable to replace it
Removed use of array forEach, breaks in older browsers (Martin Hansen)
Sinon 1.7 has split calls out to a separate file. This caused some problems, so 1.7.2 ships with spyCall as part of spy.js like it used to be.
Fake XMLHttpRequest updated to call onerror and onsuccess callbacks, fixing jQuery 2.0 problems (Roman Potashow)
- Failed release, see 1.7.1
Add methods to spyCall interface: callArgOn, callArgOnWith, yieldOn, yieldToOn (William Sears)
Revert stub.reset changes that caused existing tests to fail.
Don't force "use strict" on Sinon consumers
sinon.match for arrays (Maximilian Antoni)
Strengthen a Node.JS inference to avoid quirky behavior with Mocha (which provides a shim process object)
Argument matchers (Maximilian Antoni) sinon.match.{any, same, typeOf, instanceOf, has, hasOwn, defined, truthy, falsy} as well as typeOf shortcuts for
callsArg* and yields* for stubs (TEHEK)spy.printf("%*") (Domenic Denicola)Nothing published for this version
Nothing published for this version
Stronger Node inference in sandbox
clearTimeout to not throw when called for nonexistent IDs.Fix bug in core sinon: isNode was used for both a variable and a function, causing load errors and lots of bugs. Should have never left the door.
Support using bare functions as fake server response handlers (< 1.3.0 required URL and/or method matcher too)
Support using bare functions as fake server response handlers (< 1.3.0 required URL and/or method matcher too)
Log some internal errors to sinon.log (defaults to noop). Set sinon.log to your logging utility of choice for better feedback when.
White-list fake XHRs: Allows some fake requests and some that fall through to the backend server (Tim Ruffles)
Decide Date.now support at fake-time. Makes it possible to load something that polyfills Date.now after Sinon loaded and still have Date.now on fake Dates.
Mirror properties on replaced function properties
New methods: spy.yield(), spy.yieldTo(), spy.callArg() and spy.callArgWith() can be used to invoke callbacks passed to spies (while avoiding the mock-like upfront yields() and friends). invokeCallback is available as an alias for yield for people working with strict mode. (Maximilian Antoni)
New properties: spy.firstCall, spy.secondCall, spy.thirdCall and spy.lastCall. (Maximilian Antoni)
New method: stub.returnsArg(), causes stub to return one of its arguments. (Gavin Huang)
Stubs now work for inherited methods. This was previously prohibited to avoid stubbing not-yet-implemented methods. (Felix Geisendörfer)
server.respond() can now accept the same arguments as server.respondWith() for quick-and-dirty respondWith+respond. (Gavin Huang)
Format objects with buster-format in the default bundle. Default to util.inspect on node unless buster-format is available (not a hard dependency, more like a 'preference').
Bug fix: Make sure XHRs can complete even if onreadystatechange handler fails
Bug fix: Mirror entire Date.prototype, including toUTCString when faking
Bug fix: Default this object to global in exposed asserts
Bug fix: sinon.test: use try/finally instead of catch and throw - preserves stack traces (Kevin Turner)
Bug fix: Fake setTimeout now returns ids greater than 0. (Domenic Denicola)
Bug fix: NPM install warning (Felix Geisendörfer)
Bug fix: Fake timers no longer swallows exceptions (Felix Geisendörfer)
Bug fix: Properly expose all needed asserts for node
Bug fix: wrapMethod on window property (i.e. when stubbing/spying on global functions)
Bug fix: Quote "yield" (Ben Hockey)
Bug fix: callOrder works correctly when spies have been called multiple times
Bug fix: abort() switches state to DONE when OPENED and sent. Fix by Tristan Koch.
Fix broken mock verification in CommonJS when not including the full Sinon package.
The fake server now has a autoRespond method which allows it to respond to requests on the fly (asynchronously), making it a good fit for mockup devel
Sandbox no longer tries to use a fake server if config says so, but server is not loaded
Make sure sinon.sandbox is exposed in node.js (fix by Gord Tanner)
Breaking change: thisObj -> thisValue Change brings consistency to the code-base, always use thisValue
Switched indentation from 2 to 4 spaces :)
Node.js compatibility improvements
Remove magic booleans from sinon.assert.expose, replace with option object
Put QUnit adapter in its own repository
Update build script to build standalone timers and server files
Breaking change: thisObj -> thisValue Change brings consistency to the code-base, always use thisValue
Add sinon.assert.pass callback for successful assertions
Extract sandbox configuration from sinon.test
Refactored sinon.test to not do all the heavy lifting in creating sandbox objects from sinon.config. Now sinon.sandbox.create accepts an optional configuration that can be retrieved through sinon.getConfig({ ... }) - or, to match previous behavior, through sinon.getConfig(sinon.config);
The default configuration now lives in sinon.defaultConfig rather than the previous sinon.test.
This change enables external tools, such as test framework adapters, to easily create configurable sandboxes without going through sinon.test
Rewrite sinon.clock.tick to fix bug and make implementation clearer
Test config load correct files
Make timers and XHR truly standalone by splitting the IE work-around in two files
Don't fail when comparing DOM elements in sinon.deepEqual (used in calledWith(...))
Should mirror properties on Date when faking it
Added and updated configuration for both JsLint and JavaScript lint
[August Lilleaas] The build script can optionally build a file without the version name in it, by passing 'plain', i.e. './build plain'.
Useful when using the build script to build and use sinon programatically, so one can 'cp path/to/sinon/pkg/sinon.js my/scripts/'
[August Lilleaas] Checking and warning if we got a load error and rubygems isn't present.
[August Lilleaas] Updating build script to be runnable from any directory. Current working directory doesn't have to be repo root.
Nothing published for this version
Fixed another bug in sinon.fakeServerWithClock where consecutive respond() calls did not trigger timeouts.
Your coding agent can read these notes before it upgrades. Set up the MCP server →