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

Document that it is allowed to assert on dedicated spy calls. #1688

Merged
merged 6 commits into from Feb 24, 2018
Merged

Document that it is allowed to assert on dedicated spy calls. #1688

merged 6 commits into from Feb 24, 2018

Conversation

Flarna
Copy link
Contributor

@Flarna Flarna commented Feb 13, 2018

Purpose (TL;DR) - mandatory

Document that some asserts can be done on a SpyCall not only on a Spy. Fixes #1471

I updated only master of the doc. Once I'm told that wording is ok and change is accepted I can update also older releases.

How to verify - mandatory

N/A - just doc update

Checklist for author

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

@mroderick
Copy link
Member

Thank you for your pull request @Flarna

Reviewing this pull request allowed me to discover that we are missing tests for some of the assertions. Only in one place do we verify that an assertion also works with a spyCall as the first argument.

Would you be up for expanding your pull request?

  • Add missing documentation for all the assertions that supports both spy and spyCall
  • Add missing tests for all the assertions that supports both spy and spyCall
  • Change documentation examples to use spyOrSpyCall as the name of the first argument
    sinon.assert.calledWith(spyOrSpyCall, arg1, arg2, ...);

@mroderick mroderick added Documentation Improvement semver:patch changes will cause a new patch version labels Feb 22, 2018
@Flarna
Copy link
Contributor Author

Flarna commented Feb 22, 2018

sure, will do that - hopefully soon.

Add missing documentation for all the assertions that supports both spy and spyCall

I thought I found all of them - but looking again I think that I forgot calledWithNew. Do you know if there are others which should support spy and spyCall?

@Flarna
Copy link
Contributor Author

Flarna commented Feb 22, 2018

@mroderick Updated docs and added tests. I tried to act like a a roman in rome in the tests; hope it fits.

Still pending is the merge into older docs.

@mroderick
Copy link
Member

Looks good to me 👍

Do go ahead and fold the documentation updates into the older docs.

@Flarna
Copy link
Contributor Author

Flarna commented Feb 23, 2018

@mroderick older docs are updated now

@mroderick mroderick merged commit ae22a33 into sinonjs:master Feb 24, 2018
@mroderick
Copy link
Member

This has been published to npm as sinon@4.4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvement semver:patch changes will cause a new patch version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doc: Pass a SinonSpyCall to sinon.assert.calledWith()
2 participants