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

.eql() is broken in ES6 #158

Open
teppeis opened this issue Aug 29, 2016 · 3 comments
Open

.eql() is broken in ES6 #158

teppeis opened this issue Aug 29, 2016 · 3 comments

Comments

@teppeis
Copy link

teppeis commented Aug 29, 2016

Following tests should not pass, but pass in Node v4+ and modern browsers that support ES6.

expect('a').to.be.eql(['a']);
expect('a').to.be.eql({0: 'a'});
expect(1).to.be.eql({});
expect(true).to.be.eql({});

Change of Object.keys in ES6 causes this issue.
I've fixed same issues in Node.js core assert.deepEqual and commonjs-assert.

@pomle
Copy link

pomle commented Oct 7, 2016

Was there a test for this in expect that used eql()?

@larsgw
Copy link

larsgw commented May 3, 2018

expect([]).to.eql({})

This passes as well, although that may be intended behaviour.

@Kequc
Copy link

Kequc commented Aug 29, 2018

expect({ a: '1' }).to.eql({ a: 1 })

This also passes. I understand it's because the two values loosely equal one another but maybe there could be a separate method for comparing objects?

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

4 participants