sinonjs / sinon

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

docs(sandbox): fix example that defines a non-function property #2543

Closed MrChocolatine closed 10 months ago

MrChocolatine commented 10 months ago

Purpose (TL;DR)

This PR follows #2539 and fixes the example that defines a non-function property when using .define().

Solution

This fixes works by following the tests of .define(): https://github.com/sinonjs/sinon/blob/baa1aee9e5766ff1bfcbc62d81ddaf3138174c54/test/sandbox-test.js#L819-L833

How to verify

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

Checklist for author

codecov[bot] commented 10 months ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (baa1aee) 95.95% compared to head (83ce3a9) 95.95%.

:exclamation: Current head 83ce3a9 differs from pull request most recent head 53320b1. Consider uploading reports for the commit 53320b1 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #2543 +/- ## ======================================= Coverage 95.95% 95.95% ======================================= Files 40 40 Lines 1904 1904 ======================================= Hits 1827 1827 Misses 77 77 ``` | [Flag](https://app.codecov.io/gh/sinonjs/sinon/pull/2543/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/2543/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | `95.95% <ø> (ø)` | | 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.

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

fatso83 commented 10 months ago

Thanks!