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

fix(2525): ensure non empty message when error of type string is passed, but no message #2544

Conversation

peanutenthusiast
Copy link
Contributor

Purpose (TL;DR) - mandatory

When an error of type String and an undefined message are passed to throwsException, ensure a non-empty error.message

See issue: #2525

How to verify - mandatory

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

Checklist for author

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

Note: The branch currently causes this test to fail, so I'd appreciate guidance on whether expectations change, given this will result in a major semver change.

test/stub-test.js Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 85.71% and project coverage change: -0.09% ⚠️

Comparison is base (2ddf7ff) 96.03% compared to head (fc58ed5) 95.95%.
Report is 3 commits behind head on main.

❗ Current head fc58ed5 differs from pull request most recent head 4267025. Consider uploading reports for the commit 4267025 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2544      +/-   ##
==========================================
- Coverage   96.03%   95.95%   -0.09%     
==========================================
  Files          40       40              
  Lines        1892     1904      +12     
==========================================
+ Hits         1817     1827      +10     
- Misses         75       77       +2     
Flag Coverage Δ
unit 95.95% <85.71%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
lib/sinon/util/core/default-config.js 100.00% <ø> (ø)
lib/sinon/sandbox.js 97.34% <84.61%> (-0.79%) ⬇️
lib/sinon/default-behaviors.js 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fatso83
Copy link
Contributor

fatso83 commented Sep 13, 2023

Just fix the Prettier thingie and this is good to merge :)

npm run prettier:write

@peanutenthusiast
Copy link
Contributor Author

Done!

lib/sinon/default-behaviors.js Outdated Show resolved Hide resolved
Co-authored-by: Morgan Roderick <20321+mroderick@users.noreply.github.com>
@mroderick mroderick merged commit c339605 into sinonjs:main Sep 13, 2023
8 checks passed
@mroderick
Copy link
Member

Thank you for your contribution! 🥳

This has been published to the npm registry as part of sinon@16.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants