We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 26c625c commit 2593b40Copy full SHA for 2593b40
test/parallel/test-assert-deep.js
@@ -915,6 +915,27 @@ assert.deepStrictEqual(obj1, obj2);
915
);
916
}
917
918
+// Strict equal with identical objects that are not identical
919
+// by reference and longer than 30 elements
920
+// E.g., assert.deepStrictEqual({ a: Symbol() }, { a: Symbol() })
921
+{
922
+ const a = {};
923
+ const b = {};
924
+ for (let i = 0; i < 35; i++) {
925
+ a[`symbol${i}`] = Symbol();
926
+ b[`symbol${i}`] = Symbol();
927
+ }
928
+
929
+ assert.throws(
930
+ () => assert.deepStrictEqual(a, b),
931
+ {
932
+ code: 'ERR_ASSERTION',
933
+ name: 'AssertionError [ERR_ASSERTION]',
934
+ message: /\.\.\./g
935
936
+ );
937
+}
938
939
// Basic valueOf check.
940
{
941
const a = new String(1);
0 commit comments