Rstest provides some utility functions to help you mock functions.
Creates a spy on a function.
Creates a spy on a method of an object.
Determines if the given function is a mocked function.
Clears the mock.calls
, mock.instances
, mock.contexts
and mock.results
properties of all mocks.
Clears all mocks properties and reset each mock's implementation to its original.
Reset all mocks and restore original descriptors of spied-on objects.