Extends assume with assertions for the Sinon.JS mocking framework
MIT License
Extends assume with assertions against the Sinon.JS unit-test mocking framework.
The following flags are added:
always
The following new methods are introduced:
Assert if the value is spy.
assume(spy).is.spylike();
Assert that the function called x amount of times.
assume(spy).is.called(20);
Assert that the function called with new
.
assume(spy).is.calledWithNew();
assume(spy).is.always.calledWithNew();
Assert that the function called before a given sinon spy.
assume(spy).is.calledBefore(otherspy);
Assert that the function called after a given sinon spy.
assume(spy).is.calledAfter(otherspy);
Assert that the function called on a given object.
assume(spy).is.calledOn(thisvalue);
Assert that the function called with the given arguments.
assume(spy).is.calledWith('foo', 'bar');
Assert that the function called with matching arguments.
assume(spy).is.calledWithMatch('foo', 'bar');
Assert that the function called with matching arguments.
assume(spy).is.calledWithExactly('foo', 'bar');
Assert that the function has returned a given value.
assume(spy).has.returned(true);
Assert that the function has thrown.
assume(spy).thrown(new Error('and error'));
MIT