diff --git a/chai.js b/chai.js index ffe12c426..55f7a5ac4 100644 --- a/chai.js +++ b/chai.js @@ -932,11 +932,16 @@ module.exports = { * ### config.truncateThreshold * * User configurable property, sets length threshold for actual and - * expected values in assertion errors. If this threshold is exceeded, - * the value is truncated. + * expected values in assertion errors. If this threshold is exceeded, for + * example for large data structures, the value is replaced with something + * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`. * * Set it to zero if you want to disable truncating altogether. * + * This is especially userful when doing assertions on arrays: having this + * set to a reasonable large value makes the failure messages readily + * inspectable. + * * chai.config.truncateThreshold = 0; // disable truncating * * @param {Number} diff --git a/lib/chai/config.js b/lib/chai/config.js index 36007e8f2..e6f38fff2 100644 --- a/lib/chai/config.js +++ b/lib/chai/config.js @@ -34,11 +34,16 @@ module.exports = { * ### config.truncateThreshold * * User configurable property, sets length threshold for actual and - * expected values in assertion errors. If this threshold is exceeded, - * the value is truncated. + * expected values in assertion errors. If this threshold is exceeded, for + * example for large data structures, the value is replaced with something + * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`. * * Set it to zero if you want to disable truncating altogether. * + * This is especially userful when doing assertions on arrays: having this + * set to a reasonable large value makes the failure messages readily + * inspectable. + * * chai.config.truncateThreshold = 0; // disable truncating * * @param {Number}