Like yield, but with an explicit argument number specifying which callback to call. Useful if a function is called with more than one callback, and simply calling the first callback is not desired.
Like callArg, but with arguments.
Returns true if the spy was called at least once with @param obj as this. calledOn also accepts a matcher spyCall.calledOn(sinon.match(fn)) (see matchers).
Returns true if spy was called at exactly once with the provided arguments.
Returns true if spy was called at least once with the provided arguments. Can be used for partial matching, Sinon only checks the provided arguments against actual arguments, so a call that received the provided arguments (in the same spots) and possibly others as well will return true.
Returns true if spy was called at least once with the provided arguments and no others.
Returns true if spy was called with matching arguments (and possibly others). This behaves the same as spy.calledWith(sinon.match(arg1), sinon.match(arg2), ...).
Returns true if spy/stub was called the new operator. Beware that this is inferred based on the value of the this object and the spy function’s prototype, so it may give false positives if you actively return the right kind of object.
Returns true if call did not receive provided arguments.
Returns true if call did not receive matching arguments. This behaves the same as spyCall.notCalledWith(sinon.match(arg1), sinon.match(arg2), ...).
Returns true if spy returned the provided value at least once. Uses deep comparison for objects and arrays. Use spy.returned(sinon.match.same(obj)) for strict comparison (see matchers).
Returns true if spy threw an exception at least once.
Returns true if spy threw an exception of the provided type at least once.
Returns true if spy threw the provided exception object at least once.
Invoke callbacks passed to the stub with the given arguments. If the stub was never called with a function argument, yield throws an error. Returns an Array with all callbacks return values in the order they were called, if no error is thrown. Also aliased as invokeCallback.
Invokes callbacks passed as a property of an object to the stub. Like yield, yieldTo grabs the first matching argument, finds the callback and calls it with the (optional) arguments.
Array of received arguments.