diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 927e121ef3baee..f83458a6a1d70f 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -90,9 +90,9 @@ function createErrDiff(actual, expected, operator) { var skipped = false; const util = lazyUtil(); const actualLines = util - .inspect(actual, { compact: false }).split('\n'); + .inspect(actual, { compact: false, customInspect: false }).split('\n'); const expectedLines = util - .inspect(expected, { compact: false }).split('\n'); + .inspect(expected, { compact: false, customInspect: false }).split('\n'); const msg = `Input A expected to ${operator} input B:\n` + `${green}+ expected${white} ${red}- actual${white}`; const skippedMsg = ' ... Lines skipped'; @@ -235,8 +235,10 @@ class AssertionError extends Error { } else if (errorDiff === 1) { // In case the objects are equal but the operator requires unequal, show // the first object and say A equals B - const res = util - .inspect(actual, { compact: false }).split('\n'); + const res = util.inspect( + actual, + { compact: false, customInspect: false } + ).split('\n'); if (res.length > 20) { res[19] = '...'; diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index e3088360e3324b..96d5ff20a5ce26 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -899,7 +899,11 @@ common.expectsError( message: `${start}\n` + `${actExp}\n` + '\n' + - ' {}' + `${minus} {}\n` + + `${plus} {\n` + + `${plus} loop: 'forever',\n` + + `${plus} [Symbol(util.inspect.custom)]: [Function]\n` + + `${plus} }` }); // notDeepEqual tests