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

Failing expect build in Safari and IE #3

Closed
mjackson opened this issue Dec 10, 2015 · 12 comments
Closed

Failing expect build in Safari and IE #3

mjackson opened this issue Dec 10, 2015 · 12 comments
Assignees

Comments

@mjackson
Copy link

I'm not 100% sure this is an is-equal bug, but it seems like it.

The expect build is failing in Safari and IE. See https://travis-ci.org/mjackson/expect/builds/96101892

It looks like the stack traces originate from inside is-equal. Would you mind taking a look, @ljharb?

@ljharb
Copy link
Member

ljharb commented Dec 10, 2015

Sure - I'll look into this today.

https://github.com/mjackson/expect/blob/master/modules/__tests__/toEqual-test.js#L32-L35 appears to be one of the failing tests.

I suspect this is because Map/Set in Safari 8 can only be iterated by for..of - I'll probably have to use a technique like https://github.com/ljharb/map-tojson/blob/master/index.js#L9-L28 for that, which is pretty ugly.

IE 9 - 11 I'm not sure, but I'll look into that today also.

@ljharb ljharb self-assigned this Dec 10, 2015
@ljharb
Copy link
Member

ljharb commented Dec 10, 2015

OK so. In Safari 8, Symbol.iterator does not exist - Map and Set do, but the only way they are iterable is with for..of or their forEach method. I'll have to add some fallback code to handle that case.

@mjackson
Copy link
Author

Hmm, I wonder if that's the case in IE as well.

@ljharb
Copy link
Member

ljharb commented Dec 10, 2015

IE 11 seems to pass with my Safari 8 fix. Pushing up soon.

@ellbee
Copy link

ellbee commented Dec 10, 2015

I am seeing a breakage in the redux build (which uses expect). It seems to be due to object key order.

var isEqual = require('is-equal')

var a = {a: 1, b: 2, c: 3}
var b = {a: 1, c: 3, b: 2}

console.log(isEqual(a,b))  // prints false

ljharb added a commit that referenced this issue Dec 10, 2015
@ljharb ljharb closed this as completed in 85d90cf Dec 10, 2015
@mjackson
Copy link
Author

Ah, sorry @ellbee. I may have made the switch to is-equal prematurely. Can you please open an issue on expect and reference this one?

@ellbee
Copy link

ellbee commented Dec 10, 2015

No worries, will do.

@ljharb
Copy link
Member

ljharb commented Dec 10, 2015

Also please file a separate issue here - I think 2517c21 broke this, by causing object key ordering to start mattering. I'll fix that ASAP also.

@ljharb
Copy link
Member

ljharb commented Dec 10, 2015

@ellbee @mjackson the ordering thing was an unintentional breaking change; I've reverted that and v1.3.1 will be published that fixes that (as well as this issue)

@ellbee
Copy link

ellbee commented Dec 10, 2015

Great, thank you.

ljharb added a commit that referenced this issue Dec 10, 2015
…atter.

Fixes #3 (comment)

This reopens #2 and disables the test for circular reference handling.
@mjackson
Copy link
Author

🎉 Thanks for the quick turnaround here, @ljharb! I've updated expect to use is-equal 1.4.0. Here's to a bright future making testing better :)

@ljharb
Copy link
Member

ljharb commented Dec 11, 2015

( ゚◡゚)/ please file any issues that come up and i'll get to them asap :-)

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

3 participants