Skip to content

Commit

Permalink
chore: fix xvfb in travis config, patch safari karma launchers (#5755)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonocasey authored and gkatsev committed Jan 15, 2019
1 parent b27f713 commit 144907f
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 32 deletions.
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",
"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) {

0 comments on commit 144907f

Please sign in to comment.