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

test: skip failing .include tests in IE11 #1005

Merged
merged 1 commit into from Jul 10, 2017

Conversation

meeber
Copy link
Contributor

@meeber meeber commented Jul 9, 2017

Contrary to spec, IE11 uses SameValue instead of SameValueZero
equality for Sets.

Contrary to spec, IE11 uses SameValue instead of SameValueZero
equality for Sets.
@meeber
Copy link
Contributor Author

meeber commented Jul 9, 2017

@keithamus @lucasfcosta @vieiralucas Hey guys, are any of you around? I'd like to get a second approval on this small PR so we can (hopefully) have a passing build before releasing v4.1.

@meeber meeber mentioned this pull request Jul 10, 2017
@keithamus
Copy link
Member

This feels wrong to me. The point of having an assertion library is to smooth out these bugs. If IE11 misbehaves we should be fixing it. If we feel like we want to get 4.1 out, then we can merge this for now - but I'd expect us to quickly be releasing a 4.1.1 to fix this properly.

@meeber
Copy link
Contributor Author

meeber commented Jul 10, 2017

@keithamus Here is the problem (using plain JavaScript, with Chai removed from the equation):

var blah = new Set();
blah.add(-0);

blah.has(0); // IE11: false; others: true

blah.add(0);

blah.size; // IE11: 2, others: 1

In the example above, the answer to these two questions is different between IE11 and other browsers:

  • Is 0 included in the Set after -0 is added?
  • What's the size of the Set after both 0 and -0 are added?

From Chai's perspective, we seem to have two options:

  • Accurately reflect whether or not 0 or -0 is included in the given set based on the current environment
  • Accurately reflect whether or not 0 or -0 is included in the given set in most browsers, but lie about it in IE11

We're faced with the same dilemma once we add a .size assertion for checking the size of Sets. Should such a Chai assertion consider the size of the Set above to be 1 or 2 in IE11?

My currently feeling is that Chai should accurately reflect what's happening in the engine. This would give a tester a notice that their code is behaving differently (in an unexpected way) between different engines, and that they likely need to change it.

@keithamus
Copy link
Member

My currently feeling is that Chai should accurately reflect what's happening in the engine. This would give a tester a notice that their code is behaving differently (in an unexpected way) between different engines, and that they likely need to change it.

Yes. This rebuttal convinces me then. Frustrating how even modern IEs still plague us with issues 😞

@keithamus keithamus merged commit 3397dda into chaijs:master Jul 10, 2017
@meeber meeber deleted the skip-failing-tests branch August 6, 2017 13:49
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

Successfully merging this pull request may close these issues.

None yet

3 participants