test: ensure all webContents are closed

This commit is contained in:
John Kleinschmidt
2024-11-21 15:06:54 -05:00
parent f261c40870
commit a3280eb975

View File

@@ -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