Skip to content

Consider alternatives to deepEqual #3476

@ptomato

Description

@ptomato

We briefly discussed in the maintainers' meeting of 2022-04-07, the deepEqual file in the harness has some problems in its semantics and we should at least encourage new tests not to use it, while working out a better way to provide that functionality.

I've taken a look at what uses it and identified three categories:

  1. Comparing two arrays with primitive values in them ­— it seems to me this can be replaced wholesale by compareArray, which is clearer and more fit for purpose anyway.
  2. Comparing two objects with primitive values as their keys, where order of assignment doesn't does matter.
  3. Comparing two arrays with non-primitive values in them.

Here are the places where it's currently used:

Providing alternatives for the remaining uses could be an interesting first test of our RFC process once I have come up with a proposal for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions