Function stub
- stub<Self, Prop>(self, property): Stub<Self, GetParametersFromProp<Self, Prop>, GetReturnFromProp<Self, Prop>>
Type Parameters
Parameters
Returns Stub<Self, GetParametersFromProp<Self, Prop>, GetReturnFromProp<Self, Prop>>
The stub function which replaced the original.
- stub<Self, Prop>(self, property, func): Stub<Self, GetParametersFromProp<Self, Prop>, GetReturnFromProp<Self, Prop>>
Replaces an instance method with a Stub with the given implementation.
Type Parameters
Parameters
- self: Self
The instance to replace a method of.
- property: Prop
The property of the instance to replace.
- func: ((this: Self, ...args: GetParametersFromProp<Self, Prop>) => GetReturnFromProp<Self, Prop>)
The fake implementation of the function.
- (this, ...args): GetReturnFromProp<Self, Prop>
Parameters
- this: Self
Rest...args: GetParametersFromProp<Self, Prop>
Returns GetReturnFromProp<Self, Prop>
Returns Stub<Self, GetParametersFromProp<Self, Prop>, GetReturnFromProp<Self, Prop>>
The stub function which replaced the original.
- self: Self
Replaces an instance method with a Stub with empty implementation.