Class - test : FunctionStub

Represents an object that allows stubbing function invocations

Methods

Sets the value to be returned when the function is called.

Sets the arguments list to consider when stubbing the function call.

Sets the function behavior to do nothing when called

Sets a function to be invoked when the real function is called.

Sets the original function to be invoked.

thenReturn

(any | error returnValue)

Isolated Function

Sets the value to be returned when the function is called.

Parameters

  • returnValue any | error
  • value or error to return

withArguments

(anydata | error... args)

returns FunctionStub
Isolated Function

Sets the arguments list to consider when stubbing the function call.

Parameters

  • args anydata | error...
  • arguments list

  • Return Type

    (FunctionStub)
  • object that allows stubbing calls to a function

doNothing

()

Isolated Function

Sets the function behavior to do nothing when called

call

(string functionName)

Isolated Function

Sets a function to be invoked when the real function is called.

Parameters

  • functionName string
  • mock function to call in place of the real

callOriginal

()

Isolated Function

Sets the original function to be invoked.