Skip to content

Set equality is unexpectedly ordered #93

@rnewman

Description

@rnewman
  it('Compares sets correctly.', (done) => {
    expect(new Set(['a', 'b'])).toEqual(new Set(['b', 'a']));
    done();
  });
      Error: Expected Set (2) {'a', 'b'} to equal Set (2) {'b', 'a'}
      + expected - actual

      -["a","b"]
      +["b","a"]

This is with 1.18.0. I expect set equality to be independent of order; the order of elements is an implementation detail.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions