8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 968b867 commit 9abbb6bCopy full SHA for 9abbb6b
lib/internal/errors.js
@@ -110,6 +110,8 @@ function createErrDiff(actual, expected, operator) {
110
}
111
actualLines.pop();
112
expectedLines.pop();
113
+ if (actualLines.length === 0 || expectedLines.length === 0)
114
+ break;
115
a = actualLines[actualLines.length - 1];
116
b = expectedLines[expectedLines.length - 1];
117
test/parallel/test-assert.js
@@ -25,6 +25,7 @@
25
26
const common = require('../common');
27
const assert = require('assert');
28
+const { inspect } = require('util');
29
const a = assert;
30
31
function makeBlock(f) {
@@ -890,6 +891,17 @@ common.expectsError(
890
891
() => assert.deepEqual(Array(12).fill(1), Array(12).fill(2)),
892
{ message });
893
894
+ const obj1 = {};
895
+ const obj2 = { loop: 'forever' };
896
+ obj2[inspect.custom] = () => '{}';
897
+ // No infinite loop and no custom inspect.
898
+ assert.throws(() => assert.deepEqual(obj1, obj2), {
899
+ message: `${start}\n` +
900
+ `${actExp}\n` +
901
+ '\n' +
902
+ ' {}'
903
+ });
904
+
905
// notDeepEqual tests
906
message = 'Identical input passed to notDeepStrictEqual:\n[\n 1\n]';
907
assert.throws(