Intercept calls to a method to track the arguments, call site,
and return/throw status, and replace the implementation.
By default, the method is set to a no-op. To retain the method behavior,
pass the current value of the method as the third argument. For example:
constresults = t.capture(obj, 'foo', obj.foo)
Automatically restores at t.teardown() if the @tapjs/after
plugin is not disabled. Otherwise, it is important to call the
restore() method on the returned function when you are done capturing.
Intercept calls to a method to track the arguments, call site, and return/throw status, and replace the implementation.
By default, the method is set to a no-op. To retain the method behavior, pass the current value of the method as the third argument. For example:
Automatically restores at
t.teardown()
if the@tapjs/after
plugin is not disabled. Otherwise, it is important to call therestore()
method on the returned function when you are done capturing.