Changelog
1.5.0
Changelog
1.4.1
Changelog
1.4.0
callsArg*
and yields*
for stubs (TEHEK)spy.printf("%*")
(Domenic Denicola)Changelog
1.3.2
clearTimeout
to not throw when called for nonexistent IDs.Changelog
1.3.1
Changelog
1.3.0
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