sinonjs / sinon

Test spies, stubs and mocks for JavaScript.
https://sinonjs.org/
Other
9.67k stars 769 forks source link

fix returns does not override call through #2567

Closed rluvaton closed 1 year ago

rluvaton commented 1 year ago

Purpose (TL;DR) - mandatory

Fix issue #2566 by clearing the fake current behavior

How to verify - mandatory

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

Checklist for author

codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (1eb070a) 96.05% compared to head (e2fbca5) 96.02%. Report is 1 commits behind head on main.

:exclamation: Current head e2fbca5 differs from pull request most recent head 17bf8d5. Consider uploading reports for the commit 17bf8d5 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2567 +/- ## ========================================== - Coverage 96.05% 96.02% -0.04% ========================================== Files 41 41 Lines 1928 1913 -15 ========================================== - Hits 1852 1837 -15 Misses 76 76 ``` | [Flag](https://app.codecov.io/gh/sinonjs/sinon/pull/2567/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/sinonjs/sinon/pull/2567/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | `96.02% <100.00%> (-0.04%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/sinonjs/sinon/pull/2567?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | Coverage Δ | | |---|---|---| | [lib/sinon/default-behaviors.js](https://app.codecov.io/gh/sinonjs/sinon/pull/2567?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs#diff-bGliL3Npbm9uL2RlZmF1bHQtYmVoYXZpb3JzLmpz) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

fatso83 commented 1 year ago

Just run npm run prettier:write to fix the failing test. Usually Prettier will run as a commit hook, unless you explicitly disable those.

rluvaton commented 1 year ago

Thanks, for some reason it did not run for me

Fixed

rluvaton commented 1 year ago

Should I update package version or it's automated?

fatso83 commented 1 year ago

Version numbers are automated.

rluvaton commented 1 year ago

thanks, when the release should be?

fatso83 commented 1 year ago

It's already out (just wait a few minutes to clear the cache)

P.S. You do not ever have to wait for me to release a new Sinon version (or anyone else's package). Just use patch-package while you wait. Super good!

rluvaton commented 1 year ago

Yeah, I love patch package but prefer to avoid it as much as possible

thanks!