StubObjectMethod

StubObjectMethod

new StubObjectMethod(stubClassObject, object, methodName, overrideFunction)

object[methodName] will be overridden by overrideFunction, note that the context for overrideFunction will be the same as for object[methodName].
Source:
Parameters:
Name Type Description
stubClassObject
object Object Object which contains the method to be stubbed.
methodName string Name of the method inside the object which has to be stubbed.
overrideFunction function Function with which object[methodName] has to be stubbed.

Members

callCount

Returns total number of times object[methodName] is called.
Source:

callingArgs

Returns list of arguments passed to object[methodName] for every function call.
Source:

Methods

restore()

Restores object[methodName] to its original state.
Source: