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 res = inspectValue(actual);
|
||||||
let other = inspectValue(expected);
|
let other = inspectValue(expected);
|
||||||
const knownOperators = kReadableOperator[operator];
|
const knownOperators = kReadableOperator[operator];
|
||||||
if ((operator === 'notDeepEqual' || operator === 'notEqual') &&
|
if (operator === 'notDeepEqual' && res === other) {
|
||||||
res === other) {
|
|
||||||
res = `${knownOperators}\n\n${res}`;
|
res = `${knownOperators}\n\n${res}`;
|
||||||
if (res.length > 1024) {
|
if (res.length > 1024) {
|
||||||
res = `${res.slice(0, 1021)}...`;
|
res = `${res.slice(0, 1021)}...`;
|
||||||
@ -389,7 +388,7 @@ class AssertionError extends Error {
|
|||||||
if (other.length > 512) {
|
if (other.length > 512) {
|
||||||
other = `${other.slice(0, 509)}...`;
|
other = `${other.slice(0, 509)}...`;
|
||||||
}
|
}
|
||||||
if (operator === 'deepEqual' || operator === 'equal') {
|
if (operator === 'deepEqual') {
|
||||||
const eq = operator === 'deepEqual' ? 'deep-equal' : 'equal';
|
const eq = operator === 'deepEqual' ? 'deep-equal' : 'equal';
|
||||||
res = `${knownOperators}\n\n${res}\n\nshould loosely ${eq}\n\n`;
|
res = `${knownOperators}\n\n${res}\n\nshould loosely ${eq}\n\n`;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user