Only match requests for a specific function, provided here as a function signature string.
Close the connection immediately after receiving the matching request, without sending any response.
This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.
Return one or more values from the contract call. You must provide both a types and a values array,
unless you've already called forFunction()
and provided a function signature there that
includes return types.
This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.
Return an error, rejecting the contract call with the provided error message.
This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.
Timeout, accepting the request but never returning a response.
This method completes the rule definition, and returns a promise that resolves to a MockedContract once the rule is active. The MockedContract can be used later to query the seen requests that this rule has matched.
Only match requests that send certain parameters. You must provide both a types
and a parameters array, unless you've already called forFunction()
and
provided the function signature there.
Generated using TypeDoc
This builder should not be constructed directly. Call
mockNode.forCall()
instead.