-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
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 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> | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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_modules
because collaborators often don't havenode_modules/.bin
on 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/.bin
to 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