Back to Sinon

spy.restore

docs/concepts/spies/api/restore.md

22.1.0432 B
Original Source

spy.restore

Replaces the spy or stub with the original method. Only available if the spy or stub replaced an existing method.

<<< ../../../.vitepress/tests/docs/spies/api/restore.test.js

Other ways of restoring

You can also reset the whole sandbox, by using sinon.restore or sinon.reset.