diff --git a/lib/internal/assert/assertion_error.js b/lib/internal/assert/assertion_error.js index b0226e879ad9ba..7b62fca0352f5d 100644 --- a/lib/internal/assert/assertion_error.js +++ b/lib/internal/assert/assertion_error.js @@ -375,8 +375,7 @@ class AssertionError extends Error { let res = inspectValue(actual); let other = inspectValue(expected); const knownOperators = kReadableOperator[operator]; - if ((operator === 'notDeepEqual' || operator === 'notEqual') && - res === other) { + if (operator === 'notDeepEqual' && res === other) { res = `${knownOperators}\n\n${res}`; if (res.length > 1024) { res = `${res.slice(0, 1021)}...`; @@ -389,7 +388,7 @@ class AssertionError extends Error { if (other.length > 512) { other = `${other.slice(0, 509)}...`; } - if (operator === 'deepEqual' || operator === 'equal') { + if (operator === 'deepEqual') { const eq = operator === 'deepEqual' ? 'deep-equal' : 'equal'; res = `${knownOperators}\n\n${res}\n\nshould loosely ${eq}\n\n`; } else {