Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map deepEquals always returns true #730

Closed
dpwrussell opened this issue Jun 15, 2016 · 1 comment
Closed

Map deepEquals always returns true #730

dpwrussell opened this issue Jun 15, 2016 · 1 comment

Comments

@dpwrussell
Copy link

dpwrussell commented Jun 15, 2016

It seems that deepEquals is not working correctly for Map (or whatever that is being transpiled into by babel)

    it('Dummy map test', () => {

      const beforeState = new Map([[1, 'a'], [2, 'b']]);

      // Any one of these will be considered deeply equal
      // This one correctly equal
      // const afterState = new Map([[1, 'a'], [2, 'b']]);
      // None of these ones are correct
      // const afterState = new Map([[1, 'a'], [2, 'c']]);
      // const afterState = new Map([[1, 'a'], [3, 'b']]);
      const afterState = new Map();

      chai.assert.deepEqual(beforeState, afterState);
    });

Test run like so:

$ node_modules/mocha/bin/mocha --compilers js:babel-core/register

Result:

✓ Dummy map test
@meeber
Copy link
Contributor

meeber commented Jun 15, 2016

@dpwrussell Thanks for posting! This is a known issue in the deep-eql module used by Chai but is actively being worked on as part of a major refactor. Status of that issue can be tracked at chaijs/deep-eql#4. Gonna close this one as a duplicate.

@meeber meeber closed this as completed Jun 15, 2016
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

No branches or pull requests

2 participants