From 895c2b1421b03ebd9d13f0d11b524346dfca00c9 Mon Sep 17 00:00:00 2001 From: Ben Demboski Date: Thu, 4 Oct 2018 16:48:12 -0700 Subject: [PATCH] Fix for testing against electron 3 on windows https://github.com/electron/electron/pull/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. --- lib/test-support/test-main.js | 2 +- lib/test-support/test-runner.js | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/test-support/test-main.js b/lib/test-support/test-main.js index 1c9adbbf..09cd660e 100644 --- a/lib/test-support/test-main.js +++ b/lib/test-support/test-main.js @@ -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 { diff --git a/lib/test-support/test-runner.js b/lib/test-support/test-runner.js index fc46a661..3a0b0b85 100644 --- a/lib/test-support/test-runner.js +++ b/lib/test-support/test-runner.js @@ -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);