Back to Sinon

spy.exceptions

docs/concepts/spies/api/exceptions.md

22.1.0634 B
Original Source

spy.exceptions

Array of exception objects thrown, spy.exceptions[0] is the exception thrown by the first call of the fake, spy or stub.

If the call did not throw an error, the value at the call's location in .exceptions will be undefined.

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

Resetting exceptions to default

You can reset exceptions in three different ways: