From b591f83447acd5e06a41e2eba6883bf9c886e9a9 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Wed, 17 Apr 2019 13:09:56 -0400 Subject: [PATCH] Avoid binding expectOpenEvent into the closure --- spec/main-process/atom-application.new.test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spec/main-process/atom-application.new.test.js b/spec/main-process/atom-application.new.test.js index ef948cc1e..04618bfb9 100644 --- a/spec/main-process/atom-application.new.test.js +++ b/spec/main-process/atom-application.new.test.js @@ -407,16 +407,14 @@ class LaunchScenario { const app = this.addApplication() const windowPromises = [] for (const windowSpec of this.parseWindowSpecs(source)) { - const expectOpenEvent = windowSpec.roots.length > 0 || windowSpec.editors.length > 0 - if (windowSpec.editors.length === 0) { windowSpec.editors.push(null) } windowPromises.push((async (theApp, foldersToOpen, pathsToOpen) => { const window = await theApp.openPaths({ newWindow: true, foldersToOpen, pathsToOpen }) - if (expectOpenEvent) { - await emitterEventPromise(window, 'window:locations-opened') + if (foldersToOpen.length > 0 || pathsToOpen.filter(Boolean).length > 0) { + await emitterEventPromise(window, 'window:locations-opened', 15000, `preconditions('${source}')`) } return window })(app, windowSpec.roots, windowSpec.editors))