Closed ianmurrays closed 10 years ago
Stub objects work exactly as spy objects according to SinonJS' documentation, but sinon-chai matchers don't work on stubs, only spies.
The following doesn't work:
it('should call Something with the username and password', sinon.test(function () { this.stub(Something, ',method').returns({then: angular.noop}); var username = 'username', password = 'password'; Authentication.authenticate(username, password); expect(Something.request).to.have.been.calledWith(sinon.match.any, sinon.match({ username: username, password: password })); }));
But anything with spies does.
I was loading sinon and chai independently before sinon-chai in my karma runner. Working good now. Thanks!
Stub objects work exactly as spy objects according to SinonJS' documentation, but sinon-chai matchers don't work on stubs, only spies.
The following doesn't work:
But anything with spies does.