Skip to content

Commit

Permalink
assert: remove unused code
Browse files Browse the repository at this point in the history
Those two operators are not used.

PR-URL: #27676
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
  • Loading branch information
BridgeAR authored and targos committed May 17, 2019
1 parent 47184d1 commit 7cc21d8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/internal/assert/assertion_error.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}...`;
Expand All @@ -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 {
Expand Down

0 comments on commit 7cc21d8

Please sign in to comment.