Passes if spy was always called with obj as its this value.
Passes if spy was always called with the provided arguments.
Passes if spy was always called with the provided arguments and no others.
Passes if spy was always called with matching arguments. This behaves the same way as sinon.assert.alwaysCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
Like threw, only required for all calls to the spy.
Like threw, only required for all calls to the spy.
Like threw, only required for all calls to the spy.
Passes if spy was called exactly num times.
Passes if provided spies were called in the specified order.
Passes if spy was called at least once.
Passes if spy was ever called with obj as its this value. It’s possible to assert on a dedicated spy call: sinon.assert.calledOn(spy.firstCall, arg1, arg2, ...);.
Passes if spy was called once and only once.
Passes if spy was called at exactly once with the provided arguments and no others.
Passes if spy was called once with matching arguments. This behaves the same way as calling both sinon.assert.calledOnce(spy) and sinon.assert.calledWithMatch(spy, ...).
Passes if spy was called exactly three times.
Passes if spy was called exactly twice.
Passes if spy was called with the provided arguments. It’s possible to assert on a dedicated spy call: sinon.assert.calledWith(spy.firstCall, arg1, arg2, ...);.
Passes if spy was called with the provided arguments and no others. It’s possible to assert on a dedicated spy call: sinon.assert.calledWithExactly(spy.getCall(1), arg1, arg2, ...);.
Passes if spy was called with matching arguments. This behaves the same way as sinon.assert.calledWith(spy, sinon.match(arg1), sinon.match(arg2), ...). It's possible to assert on a dedicated spy call: sinon.assert.calledWithMatch(spy.secondCall, arg1, arg2, ...);.
Passes if spy was called with the new operator. It’s possible to assert on a dedicated spy call: sinon.assert.calledWithNew(spy.secondCall, arg1, arg2, ...);.
Exposes assertions into another object, to better integrate with the test framework. For instance, JsTestDriver uses global assertions, and to make Sinon.JS assertions appear alongside them, you can do.
Every assertion fails by calling this method. By default it throws an error of type sinon.assert.failException. If the test framework looks for assertion errors by checking for a specific exception, you can simply override the kind of exception thrown. If that does not fit with your testing framework of choice, override the fail method to do the right thing.
Uses sinon.match to test if the arguments can be considered a match.
Passes if spy was never called with the provided arguments.
Passes if spy was never called with matching arguments. This behaves the same way as sinon.assert.neverCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
Passes if spy was never called
Called every time assertion passes. Default implementation does nothing.
Passes if spy threw any exception.
Passes if spy threw the given exception. The exception is an actual object. It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);.
Passes if spy threw the given exception. The exception is a String denoting its type. It’s possible to assert on a dedicated spy call: sinon.assert.threw(spy.thirdCall, exception);.
Defaults to AssertError.