Registers a callback function that is invoked whenever a mock is generated for a module.
This callback is passed the module path and the newly created mock object, and must return
the (potentially modified) mock object.
If multiple callbacks are registered, they will be called in the order they were added.
Each callback receives the result of the previous callback as the moduleMock parameter,
making it possible to apply sequential transformations.
Registers a callback function that is invoked whenever a mock is generated for a module. This callback is passed the module path and the newly created mock object, and must return the (potentially modified) mock object.
If multiple callbacks are registered, they will be called in the order they were added. Each callback receives the result of the previous callback as the
moduleMock
parameter, making it possible to apply sequential transformations.