Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spy.called to accept call count to verify call count #387

Closed
tinganho opened this issue Jan 22, 2014 · 3 comments
Closed

spy.called to accept call count to verify call count #387

tinganho opened this issue Jan 22, 2014 · 3 comments

Comments

@tinganho
Copy link

It would be convenient to have a function for

spy.called(6).times // returns true if spy have been called 6 times

Than I can use sinon-chai

spy.should.have.been.called(6).times
@tinganho
Copy link
Author

And of course spy.called without function call should work as today

@cjohansen
Copy link
Contributor

Use spy.callCount to check the number of calls.

@tinganho
Copy link
Author

@cjohansen There is a reason I use spy.calledTwice instead of spy.callCount === 2, because it is more readable. (Also it would play well with sinon-chai). Though I should maybe file the issue on sinon-chairepo instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants