# What changed in sinon

> 7 changes in sinon 2 to 4 from its official release notes, upgrade guides and advisories: 3 breaking, 3 new APIs and options. Each one cited. Sources checked 2026-10-27. HTML: https://unstale.sh/npm/sinon/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## sinon 4

### Breaking changes

- Support for stubbing undefined properties was removed. (4.0.0) — [release notes](https://github.com/sinonjs/sinon/blob/HEAD/CHANGES.md)

## sinon 3

### Breaking changes

- Deprecated exports are removed. (3.0.0) — [release notes](https://github.com/sinonjs/sinon/releases/tag/v3.0.0)

### New APIs and options

- Adds format.setFormatter. (3.0.0) — [release notes](https://github.com/sinonjs/sinon/releases/tag/v3.0.0)

### Fixes and other changes

- Fixes incorrect returnValue behavior for withArgs(). (3.0.0) — [release notes](https://github.com/sinonjs/sinon/releases/tag/v3.0.0)

## sinon 2

### Breaking changes

- The SSL part of the base URL is removed. (2.0.0) — [release notes](https://github.com/sinonjs/sinon/releases/tag/v2.0.0)

### New APIs and options

- Getters and setters for function properties can now be stubbed, with getter and setter stub behaviors. (2.0.0) — [release notes](https://github.com/sinonjs/sinon/releases/tag/v2.0.0)
- Stubbed property descriptors can now be restored. (2.0.0) — [release notes](https://github.com/sinonjs/sinon/releases/tag/v2.0.0)
