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

#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

  1. use this app and point the sinon instance to this version
  2. see the logs are reduced when the setting is on

Checklist for author