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

Support spy calls in assertions #17

Merged
merged 1 commit into from Jun 30, 2018
Merged

Support spy calls in assertions #17

merged 1 commit into from Jun 30, 2018

Conversation

mantoni
Copy link
Member

@mantoni mantoni commented Jun 30, 2018

Purpose (TL;DR) - mandatory

This allows to pass a call as the first argument to sinon assertions,
e.g. assert.calledWith(spy.firstCall, 123). This is supported by Sinon
but wasn't working with this library because of the argument validateion
being too restrictive.

Solution - optional

This change removes the typeof "function" check in verifyFakes and checks if the given argument supports calledWith instead of checking for getCall.

How to verify - mandatory

  1. Check out this branch
  2. npm install
  3. npm t

Checklist for author

  • npm run lint passes
  • References to standard library functions are cached.

This allows to pass a call as the first argument to sinon assertions,
e.g. `assert.calledWith(spy.firstCall, 123)`. This is supported by Sinon
but wasn't working with this library because of the argument validateion
being too restrictive.
@mantoni mantoni requested a review from mroderick June 30, 2018 13:34
@coveralls
Copy link

Pull Request Test Coverage Report for Build 66

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.2%) to 92.982%

Files with Coverage Reduction New Missed Lines %
referee-sinon.js 1 92.98%
Totals Coverage Status
Change from base Build 63: -0.2%
Covered Lines: 122
Relevant Lines: 125

💛 - Coveralls

@mroderick
Copy link
Member

👍

@mantoni mantoni merged commit bfc9230 into master Jun 30, 2018
@mantoni mantoni deleted the support-spy-calls branch June 30, 2018 13:52
@mantoni
Copy link
Member Author

mantoni commented Jun 30, 2018

Released in v4.1.0.

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

Successfully merging this pull request may close these issues.

None yet

3 participants