Back to Sinon

fake.rejects

docs/concepts/fakes/api/rejects.md

22.1.0371 B
Original Source

fake.rejects(value)

Creates a fake that returns a rejected Promise for the passed value.

If an Error is passed as the value argument, then that will be the value of the promise. If any other value is passed, then that will be used for the message property of the Error returned by the promise.

<<< ../../../.vitepress/tests/docs/fakes/api/rejects.test.js