From a3280eb975129c13aab6526bfe490744b355dc61 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Thu, 21 Nov 2024 15:06:54 -0500 Subject: [PATCH] test: ensure all webContents are closed --- spec/api-web-contents-view-spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/api-web-contents-view-spec.ts b/spec/api-web-contents-view-spec.ts index f98bdd20a9..077cb96e30 100644 --- a/spec/api-web-contents-view-spec.ts +++ b/spec/api-web-contents-view-spec.ts @@ -9,7 +9,11 @@ import { defer, ifdescribe, waitUntil } from './lib/spec-helpers'; import { closeAllWindows } from './lib/window-helpers'; describe('WebContentsView', () => { - afterEach(closeAllWindows); + afterEach(async () => { + await closeAllWindows(); + const existingWCS = webContents.getAllWebContents(); + existingWCS.forEach((contents) => contents.close()); + }); it('can be instantiated with no arguments', () => { // eslint-disable-next-line no-new