docs/concepts/fakes/index.md
sinon.fake allows creation of a fake Function with the ability to set a default behavior.
In Sinon, a fake is a Function that records arguments, return value, the value of this and Error thrown (if any) for all of its calls.
A fake is an immutable object: once created, its behavior will not change.
<<< ../../.vitepress/tests/docs/fakes/basic-usage.test.js
Fakes are alternatives to the older spies and stubs, and can replace them in all use cases.
They are designed to be simpler and easier to use, while avoiding confusion by being immutable.
All fakes have the same API as spies. This includes access to call information through the spy call API, such as firstArg, lastArg, and callback properties.
<<< ../../.vitepress/tests/docs/fakes/_index-1.test.js
<<< ../../.vitepress/tests/docs/fakes/_index-2.test.js