docs/concepts/fakes/error-handling.md
Fakes validate their usage and throw errors when used incorrectly. Understanding these errors helps you use fakes correctly.
When creating a fake with sinon.fake(f), if you provide an argument, it must be a function.
<<< ../../.vitepress/tests/docs/fakes/_index-3.test.js
Both fake.yields() and fake.yieldsAsync() expect the last argument to be a callback function. If you call the fake without a callback, it will throw an error.
For fake.yields():
<<< ../../.vitepress/tests/docs/fakes/api/yields.test.js
For fake.yieldsAsync():
<<< ../../.vitepress/tests/docs/fakes/api/yields-async.test.js
fake.yields() or fake.yieldsAsync(), ensure the fake is called with a callback as the last argumentsinon.fake() when wrapping behaviorsinon.fake() without arguments to create an empty fake