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
Allow providing stubs overrides for sinon.createStubInstance #1864
Allow providing stubs overrides for sinon.createStubInstance #1864
Conversation
There's no need to create a new stub for already existing functions so the syntax is actually shorter.
Pull Request Test Coverage Report for Build 2602
💛 - Coveralls |
Thank you for your pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your patience ❤️ |
Hmm ... isn't the pre-test checks running on the PRs? This failed after merging to master. |
I think we changed the linting since the PR was created: |
I can fix this lint violation and update the |
The linting failed because of not using a cached reference to Even if we have just recently added the explicit check for this (good!), we did have a point in our pull request template just for this:
There is a reason we have this checklists, @ifrost, so removing them should only be done if you understand why they are there in the first place and if they are irrelevant. |
@fatso83 in fairness, those requirements were added after this PR was opened. |
@mroderick No, they were added one year ago (2017). |
Oh! |
Sorry, my bad! Thanks for fixing it! |
Purpose (TL;DR) - mandatory
Implements #1857. The solution is slightly different from what I suggested #1857 - it allows simple stub overrides or providing returned value as described in docs:
overrides
is an optional map overriding created stubs, for example:is the same as:
If provided value is not a stub, it will be used as the returned value:
is the same as:
How to verify - mandatory
npm install
npm test