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