Add a custom behavior.
The name will be available as a function on stubs, and the chaining mechanism
will be set up for you (e.g. no need to return anything from your function,
its return value will be ignored). The fn will be passed the fake instance
as its first argument, and then the user's arguments.
Replace the default formatter used when formatting ECMAScript object
An example converts a basic object, such as {id: 42 }, to a string
on a format of your choosing, such as "{ id: 42 }"
Add a custom behavior. The name will be available as a function on stubs, and the chaining mechanism will be set up for you (e.g. no need to return anything from your function, its return value will be ignored). The fn will be passed the fake instance as its first argument, and then the user's arguments.