From be8d7a69ba2921bed392c22cfd9074ede34a28c9 Mon Sep 17 00:00:00 2001 From: Vlad GURDIGA Date: Sun, 1 Mar 2015 12:44:32 +0200 Subject: [PATCH] config.truncateThreshold docs: simpler wording --- chai.js | 9 +++++++-- lib/chai/config.js | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) 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}