diff --git a/src/initialize-test-window.coffee b/src/initialize-test-window.coffee index ad15429ff..ecacddd4e 100644 --- a/src/initialize-test-window.coffee +++ b/src/initialize-test-window.coffee @@ -13,9 +13,11 @@ try AtomEnvironment = require '../src/atom-environment' ApplicationDelegate = require '../src/application-delegate' + {testRunnerPath, legacyTestRunnerPath, headless, logFile, testPaths} = getWindowLoadSettings() + # Show window synchronously so a focusout doesn't fire on input elements # that are focused in the very first spec run. - remote.getCurrentWindow().show() unless getWindowLoadSettings().headless + remote.getCurrentWindow().show() unless headless handleKeydown = (event) -> # Reload: cmd-r / ctrl-r @@ -39,15 +41,13 @@ try document.title = "Spec Suite" - legacyTestRunner = require(getWindowLoadSettings().legacyTestRunnerPath) - testRunner = require(getWindowLoadSettings().testRunnerPath) + testRunner = require(testRunnerPath) + legacyTestRunner = require(legacyTestRunnerPath) + buildAtomEnvironment = (params) -> new AtomEnvironment(params) + buildDefaultApplicationDelegate = (params) -> new ApplicationDelegate() + promise = testRunner({ - logFile: getWindowLoadSettings().logFile - headless: getWindowLoadSettings().headless - testPaths: getWindowLoadSettings().testPaths - buildAtomEnvironment: (params) -> new AtomEnvironment(params) - buildDefaultApplicationDelegate: (params) -> new ApplicationDelegate() - legacyTestRunner: legacyTestRunner + logFile, headless, testPaths, buildAtomEnvironment, buildDefaultApplicationDelegate, legacyTestRunner }) promise.then(exitWithStatusCode) if getWindowLoadSettings().headless