sinonjs / sinon

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

.define method #2539

Closed gukoff closed 10 months ago

gukoff commented 11 months ago

Purpose (TL;DR) - mandatory

Add the .define(obj, property, value) method to the sandbox to allow temporarily define properties on the objects (i.e. until the sandbox is restored).

Fixes #2195

How to verify - mandatory

Run the tests

Checklist for author

codecov[bot] commented 10 months ago

Codecov Report

Patch coverage: 85.71% and project coverage change: +0.21% :tada:

Comparison is base (fe799e7) 95.73% compared to head (ac18f5f) 95.95%. Report is 2 commits behind head on main.

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

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2539 +/- ## ========================================== + Coverage 95.73% 95.95% +0.21% ========================================== Files 40 40 Lines 1901 1904 +3 ========================================== + Hits 1820 1827 +7 + Misses 81 77 -4 ``` | [Flag](https://app.codecov.io/gh/sinonjs/sinon/pull/2539/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/2539/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | `95.95% <85.71%> (+0.21%)` | :arrow_up: | 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 Changed](https://app.codecov.io/gh/sinonjs/sinon/pull/2539?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | Coverage Δ | | |---|---|---| | [lib/sinon/util/core/default-config.js](https://app.codecov.io/gh/sinonjs/sinon/pull/2539?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs#diff-bGliL3Npbm9uL3V0aWwvY29yZS9kZWZhdWx0LWNvbmZpZy5qcw==) | `100.00% <ø> (ø)` | | | [lib/sinon/sandbox.js](https://app.codecov.io/gh/sinonjs/sinon/pull/2539?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs#diff-bGliL3Npbm9uL3NhbmRib3guanM=) | `97.34% <85.71%> (+1.82%)` | :arrow_up: |

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

fatso83 commented 10 months ago

[warn] Code style issues found in 2 files. Forgot to run Prettier?

Could you just address this and I'll merge 😄