Closed sgoossens closed 10 months ago
Would you be interested in help getting it over the finish line? Have some time these days.
Would you be interested in help getting it over the finish line? Have some time these days.
Sure that would be great. I lost track of this but think it would be a great add. I can also put some time in to addressing your feedback as well
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
8dbfd02
) 96.03% compared to head (7701afc
) 96.05%. Report is 4 commits behind head on main.:exclamation: Current head 7701afc differs from pull request most recent head ef5c456. Consider uploading reports for the commit ef5c456 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
OK, so I added test coverage, fixed up some logical errors, exposed the options on the sandbox creation, etc.
This is ready for merge from my perspective, but it does not change the default, as that would be a breaking change, but we can do that with version 18 . It still allows creating sandboxes with log limits, which is probably what you want right now.
The way I stubbed out
@sgoossens You ok with this? Anything to add/change?
Purpose (TL;DR) - mandatory
Allow for a log limit setting on the assertion object, that when true, will truncate the error.message that is returned via a failing assertion. The limit for the log message will be set to a default if none was provided
https://github.com/sinonjs/sinon/issues/2484
Background (Problem in detail) - optional
When a stubbed method has a large property on it, it is logged in the failing assertion causing runoff in the terminal and making it hard to see what assertion actually failed.
By allowing for a log limitation setting and a default log limit, error logs can be truncated.
How to verify - mandatory
Checklist for author
npm run lint
passes