mirror of https://github.com/nodejs/node.git
assert: remove unused code
Those two operators are not used. PR-URL: https://github.com/nodejs/node/pull/27676 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
5b26609e5a
commit
35fc1b4e96
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue