diff --git a/lib/reporters/base.js b/lib/reporters/base.js index 0754fe1a37..44c0d7a5fa 100644 --- a/lib/reporters/base.js +++ b/lib/reporters/base.js @@ -466,7 +466,7 @@ function stringify(obj) { function canonicalize(obj, stack) { stack = stack || []; - if (utils.indexOf(stack, obj) !== -1) return obj; + if (utils.indexOf(stack, obj) !== -1) return '[Circular]'; var canonicalizedObj; diff --git a/mocha.js b/mocha.js index 19edc87d97..66943316f1 100644 --- a/mocha.js +++ b/mocha.js @@ -2317,7 +2317,7 @@ function stringify(obj) { function canonicalize(obj, stack) { stack = stack || []; - if (utils.indexOf(stack, obj) !== -1) return obj; + if (utils.indexOf(stack, obj) !== -1) return '[Circular]'; var canonicalizedObj;