Skip to content

Commit

Permalink
doc: fix inconsistencies in WeakSet and WeakMap comparison details
Browse files Browse the repository at this point in the history
  • Loading branch information
ishon19 committed Jan 23, 2025
1 parent 905e4b4 commit 52dd838
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions doc/api/assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -909,11 +909,12 @@ weakSet2.add(obj);

// Comparing different instances fails, even with same contents
assert.deepStrictEqual(weakSet1, weakSet2);
// AssertionError: Expected inputs to be strictly deep-equal:
// AssertionError: Values have same structure but are not reference-equal:
// + actual - expected
//
// + WeakSet { <items unknown> }
// - WeakSet { <items unknown> }
// WeakSet {
// <items unknown>
// }

// Comparing the same instance to itself succeeds
assert.deepStrictEqual(weakSet1, weakSet1);
Expand Down Expand Up @@ -1018,11 +1019,12 @@ weakSet2.add(obj);

// Comparing different instances fails, even with same contents
assert.deepStrictEqual(weakSet1, weakSet2);
// AssertionError: Expected inputs to be strictly deep-equal:
// AssertionError: Values have same structure but are not reference-equal:
// + actual - expected
//
// + WeakSet { <items unknown> }
// - WeakSet { <items unknown> }
// WeakSet {
// <items unknown>
// }

// Comparing the same instance to itself succeeds
assert.deepStrictEqual(weakSet1, weakSet1);
Expand Down

0 comments on commit 52dd838

Please sign in to comment.