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

chore: fix xvfb in travis config, patch safari karma launchers #5755

Merged
merged 4 commits into from
Jan 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ cache: npm
before_install:
- npm install -g greenkeeper-lockfile@1
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- greenkeeper-lockfile-update
after_script: greenkeeper-lockfile-upload
after_failure:
Expand All @@ -14,6 +12,8 @@ after_success:
- npm run assets
addons:
chrome: stable
services:
- xvfb

env:
global:
Expand Down
130 changes: 100 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"docs:fix": "remark --output -- './{,!(node_modules)/**/}!(CHANGELOG)*.md'",
"docs:lang": "node build/translations.js",
"netlify": "babel-node ./build/netlify-docs.js",
"prepare": "patch-package",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prepare runs before packing the package when when npm install is run without anything https://docs.npmjs.com/misc/scripts

"prepublishOnly": "run-p build",
"publish": "node build/gh-release.js",
"version": "node build/version.js && git add CHANGELOG.md",
Expand Down Expand Up @@ -123,6 +124,7 @@
"node-sass": "^4.10.0",
"npm-merge-driver-install": "^1.1.1",
"npm-run-all": "^4.1.5",
"patch-package": "^5.1.1",
"postcss-cli": "^6.0.1",
"proxyquireify": "^3.2.1",
"qunit": "~2.9.1",
Expand Down
15 changes: 15 additions & 0 deletions patches/karma-safari-launcher+1.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
patch-package
--- a/node_modules/karma-safari-launcher/index.js
+++ b/node_modules/karma-safari-launcher/index.js
@@ -13,6 +13,11 @@ var SafariBrowser = function(baseBrowserDecorator) {
var content = data.toString().replace('%URL%', url);
var staticHtmlPath = self._tempDir + '/redirect.html';

+ var pathForMojave = path.join(process.env.HOME, 'Library/Containers/com.apple.Safari/Data/redirect.html');
+ if (fs.existsSync(pathForMojave)) {
+ staticHtmlPath = pathForMojave;
+ }
+
fs.writeFile(staticHtmlPath, content, function(err) {
self._execCommand(self._getCommand(), [staticHtmlPath]);
});
18 changes: 18 additions & 0 deletions patches/karma-safaritechpreview-launcher+0.0.6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
patch-package
--- a/node_modules/karma-safaritechpreview-launcher/index.js
+++ b/node_modules/karma-safaritechpreview-launcher/index.js
@@ -25,7 +25,13 @@ const SafariTechPreviewBrowser = function (baseBrowserDecorator) {
throw err;
}
const content = data.toString().replace('%URL%', url);
- const staticHtmlPath = self._tempDir + '/redirect.html';
+ var staticHtmlPath = self._tempDir + '/redirect.html';
+
+ var pathForMojave = path.join(process.env.HOME, 'Library/Containers/com.apple.SafariTechnologyPreview/Data/redirect.html');
+ if (fs.existsSync(pathForMojave)) {
+ staticHtmlPath = pathForMojave;
+ }
+
try {
yield fs.writeFile(staticHtmlPath, content);
} catch (err) {