npm / sinon
sinon
What changed in sinon 2 to 4, from its official release notes, upgrade guides and advisories. Also covers @types/sinon. Sources checked 2026-10-27.
3 breaking3 new APIs and options1 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initsinon 41 changes
Breaking changes 1
Support for stubbing undefined properties was removed.
sinon 33 changes
Breaking changes 1
Deprecated exports are removed.
New APIs and options 1
Adds format.setFormatter.
Fixes and other changes 1
Fixes incorrect returnValue behavior for withArgs().
sinon 23 changes
Breaking changes 1
The SSL part of the base URL is removed.
New APIs and options 2
Getters and setters for function properties can now be stubbed, with getter and setter stub behaviors.
Stubbed property descriptors can now be restored.