fix: assertion log limit by sgoossens · Pull Request #2485 · sinonjs/sinon (original) (raw)
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
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
- use this app and point the sinon instance to this version
- see the logs are reduced when the setting is on
Checklist for author
npm run lintpasses- References to standard library functions are cached.