From 01073980194549306c34a4f4b4922829f0142b36 Mon Sep 17 00:00:00 2001 From: Zach Bloomquist Date: Fri, 27 Aug 2021 02:11:15 -0400 Subject: [PATCH] chore(tests): suppress beforeunload to stop spec-runner from quitting over and over [wip] --- app/spec/spec-runner/spec-runner.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/spec/spec-runner/spec-runner.ts b/app/spec/spec-runner/spec-runner.ts index 49a9bc2ce..215a80063 100644 --- a/app/spec/spec-runner/spec-runner.ts +++ b/app/spec/spec-runner/spec-runner.ts @@ -120,8 +120,9 @@ class SpecRunner { } _setupWindow() { - window.addEventListener('core:close', () => window.close()); - window.addEventListener('beforeunload', () => { + window.addEventListener('beforeunload', (e) => { + // TODO(flotwig): figure out a way to stop the tests from quitting prematurely that is not this + e.returnValue = 'foo' AppEnv.storeWindowDimensions(); AppEnv.saveWindowState(); });