Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 1.8k
Firefox and Safari integration tests fixes#1029
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,12 @@ | ||
| sudo: false | ||
| language: node_js | ||
| node_js: | ||
| - "4" | ||
| - "8" | ||
| dist: trusty | ||
| addons: | ||
| chrome: stable | ||
| cache: | ||
| directories: | ||
| - node_modules | ||
| script: | ||
| - npm test | ||
| - npm test |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -37,6 +37,70 @@ | ||
| clearTimeout(id); | ||
| }; | ||
| }()); | ||
| /** | ||
| * Custom event factories for cross-browser compatibility | ||
| * | ||
| * Gecko browsers are using non-standard `initKeyEvent`, where others implemented `initKeyboardEvent`. | ||
| * To make it more consistent, we try to use standardized `MouseEvent`/`KeyboardEvent` now | ||
| * and fallback to older implementations for legacy browsers only. | ||
| * | ||
| * See deprecation notes: | ||
| * https://developer.mozilla.org/en-US/docs/Web/API/Document/createEvent | ||
| * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/initKeyEvent | ||
| * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/initKeyboardEvent | ||
| * | ||
| * References: | ||
| * https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent#Specifications | ||
| * https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Specifications | ||
| */ | ||
| function createMouseEvent (options) { | ||
| var options = { | ||
| bubbles: true, | ||
| cancelable: true, | ||
| view: window | ||
| } | ||
| if ('MouseEvent' in window) { | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't hurt to comment these branches with the browsers they're active on Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these factories are way better though 👍 | ||
| return new MouseEvent('click', options); | ||
| } else { | ||
| var event = document.createEvent('MouseEvent'); | ||
| event.initMouseEvent( | ||
| 'click', | ||
| options.bubbles, | ||
| options.cancelable, | ||
| options.view | ||
| ); | ||
| return event; | ||
| } | ||
| } | ||
| function createKeyboardEvent (key) { | ||
| var options = { | ||
| bubbles: true, | ||
| cancelable: true, | ||
| view: window, | ||
| key: key || 'a' | ||
| } | ||
| options.charCode = options.key.charCodeAt(); | ||
| if ('KeyboardEvent' in window) { | ||
| return new KeyboardEvent('keypress', options); | ||
| } else { | ||
| var event = document.createEvent('KeyboardEvent'); | ||
| event.initKeyboardEvent( | ||
| 'keypress', | ||
| options.bubbles, | ||
| options.cancelable, | ||
| options.view, | ||
| options.key, | ||
| options.charCode | ||
| ); | ||
| return event; | ||
| } | ||
| } | ||
| </script> | ||
| <script src="../../node_modules/jquery/dist/jquery.js"></script> | ||
| <script src="../../build/raven.js"></script> | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
I generally link linking to the version found in
node_modulesbecause collaborators often don't havenode_modules/.binon theirPATH.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.
I think when you run things using yarn/npm, it'll add
node_modules/.binto search path.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