test: fixup visibility tests (#44802)

* test: ensure all webContents are closed

* test: ensure all webContents are closed

* test: fixup api-web-request-spec.ts
This commit is contained in:
John Kleinschmidt 2024-11-23 10:21:38 +00:00 committed by GitHub
commit 85a0240b5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 6 deletions

View file

@ -8,7 +8,11 @@ import { defer } 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