Open ghost opened 4 years ago
There is an monkey-patch answer describing how to override the formatting method: https://stackoverflow.com/a/28652362/1633985
which I also put into an npm package (yes, I'm a bit ashamed myself):
https://github.com/TeNNoX/chai-formatter-monkeypatch
Right now, pretty-printing of objects is hard-coded to stop at a depth of 2. There already is a configuration of the truncation threshold for the length of the string via
config.truncateThreshold
, but this depth of 2 cannot be configured; even withconfig.truncateThreshold = 0
, objects will not be printed beyond a depth of 2 properties.It would be nice to be able to configure this (or disable entirely) via a property like
config.recurseThreshold
.