-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Remove Karma flakiness by providing browser shims #1119
base: master
Are you sure you want to change the base?
Conversation
* to tell karma to run a file before everything else. This is the next best | ||
* thing I guess... | ||
*/ | ||
const isBrowser = typeof window !== 'undefined' && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is a typeof window check not sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because we screw that up w/ jsdom.
Object.prototype.toString.call(window) === '[object Window]'; | ||
|
||
if (isBrowser) { | ||
require('airbnb-browser-shims'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually both safe to require in node, and recommended to do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm. doing so caused many issues. perhaps it's related to jsdom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yeah true, that makes sense.
This appears to have not actually fixed the flakiness.... so it seems like this is not the reason for the karma flakiness :/ |
@lelandrichardson it did fix flakiness caused by lack of polyfills,it just didn't fix the other cause of flakiness,some tests appear to cause a full page reload. This should still be merged |
@nfcampos any thoughts on how to fix the page reload issue? It'd be nice to fix karma in a single PR if possible. |
212f345
to
11d153e
Compare
Rebased this on top of #1096. |
40cc703
to
0a17404
Compare
2227326
to
0d5ead7
Compare
43eb75e
to
39e6b1f
Compare
This fixes the travis karma flakiness, and removes the allowed failure. This does this by adding in airbnb-browser-shims to the karma tests so that we don't have to worry about which version of chrome they are running on.