Skip to content

Commit

Permalink
Fix for testing against electron 3 on windows
Browse files Browse the repository at this point in the history
electron/electron#13039 caused our tests to fail on windows because we pass URL arguments. So, we need to add a '--' to the arguments to work around the issue.
  • Loading branch information
bendemboski committed Oct 5, 2018
1 parent a33e7e7 commit 895c2b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/test-support/test-main.js
Expand Up @@ -9,7 +9,7 @@ let mainWindow = null;
// The testUrl is a file: url pointing to our index.html, with some query
// params we need to preserve for testem. So we need to register our ember
// protocol accordingly.
let [, , indexUrl, testemUrl] = process.argv;
let [, , , indexUrl, testemUrl] = process.argv;
// Undo workaround for windows (see test-runner.js for explanation)
indexUrl = indexUrl.replace(/__amp__/g, '&');
let {
Expand Down
10 changes: 9 additions & 1 deletion lib/test-support/test-runner.js
Expand Up @@ -54,7 +54,15 @@ if (require.main === module) {
testUrl = testUrl.replace(/&/g, '__amp__');

// Start electron
efStart({ appPath: buildDir, dir: buildDir, args: [testUrl, testemUrl] }).then(({ pid }) => {
efStart({
appPath: buildDir,
dir: buildDir,
args: [
'--', // needed because https://github.com/electron/electron/pull/13039
testUrl,
testemUrl,
],
}).then(({ pid }) => {
// Clean up when we're killed
process.on('SIGTERM', () => {
treeKill(pid);
Expand Down

0 comments on commit 895c2b1

Please sign in to comment.