On this page
Migrating to v3.0
As with all MAJOR releases in semver, there are breaking changes in sinon@3. This guide will walk you through those changes.
sinon.stub(object, "method", func) - Removed
Please use sinon.stub(obj, "method").callsFake(func) instead.
var stub = sinon.stub(obj, "stubbedMethod").callsFake(function () {
return 42;
});
Codemod available at https://github.com/hurrymaplelad/sinon-codemod
sinon.stub(object, property, value) - Removed
Calling sinon.stub with three arguments will throw an Error. This was deprecated with sinon@2 and has been removed with sinon@3
sinon.useFakeTimers([now, ]prop1, prop2, ...) - Removed
sinon.useFakeTimers() signature has changed. To define which methods to fake, please use config.toFake. Other options are now available when configuring useFakeTimers. Please consult the documentation for more information.
sinon.sandbox.create(config) - Config changes
The changes in configuration for fake timers implicitly affect sandbox creation. If your config used to look like { useFaketimers: ["setTimeout", "setInterval"]}, you will now need to change it to { useFaketimers: { toFake: ["setTimeout", "setInterval"] }}.
Removal of internal helpers
The following internal functions were deprecated as of sinon@1.x and have been removed in sinon@3:
sinon.calledInOrdersinon.createsinon.deepEqualsinon.formatsinon.functionNamesinon.functionToStringsinon.getConfigsinon.getPropertyDescriptorsinon.objectKeyssinon.orderByFirstCallsinon.restoresinon.timesInWorldssinon.valueToStringsinon.walksinon.wrapMethodsinon.Eventsinon.CustomEventsinon.EventTargetsinon.ProgressEventsinon.typeOfsinon.extend
© 2010–2017 Christian Johansen
Licensed under the BSD License.
http://sinonjs.org/releases/v3.3.0/migrating-to-3.0