Skip to content

Add failing test for deepStrictEqual bug#1

Draft
CraigMacomber wants to merge 1 commit intomainfrom
BugRepro
Draft

Add failing test for deepStrictEqual bug#1
CraigMacomber wants to merge 1 commit intomainfrom
BugRepro

Conversation

@CraigMacomber
Copy link
Owner

@CraigMacomber CraigMacomber commented Mar 24, 2026

Demonstration of a bug in deepStrictEqual tracked by nodejs#62422, where two structurally equal arrays can throw the following error in specific cases:

AssertionError [ERR_ASSERTION]: Values have same structure but are not reference-equal:
  
  [
    {
      outer: {
        inner: 0
      }
    },
    {
      outer: {
        inner: 0
      }
    }
  ]

It is my understanding tht it is not intended behavior for deepStrictEqual to ever throw when objects have the same structure but are not reference-equal.

It is also my understanding that the behavior of deepStrictEqual should not be impacted by previous calls to deepStrictEqual.

As both of these assumptions seem to be violated, this appears to be a bug which regressed sometime after v22.22.1 (which did not have this behavior).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant