Back to Sinon

sandbox.reset

docs/concepts/sandboxes/api/reset.md

22.1.0569 B
Original Source

sandbox.reset();

Resets the mutable behavior in stubs as well as the history of all fakes, spies and stubs created using the sandbox.

In terms of resetting history, this is equivalent to calling sandbox.resetHistory.

Example: resetting mutable behavior of stubs

<<< @/.vitepress/tests/docs/sandboxes/api/reset-1.test.js

Example: sinon.reset does not change immutable behavior in fakes

<<< @/.vitepress/tests/docs/sandboxes/api/reset-2.test.js