diff --git a/spec-main/api-browser-view-spec.ts b/spec-main/api-browser-view-spec.ts index 2977e75984fb..f8ca8d085963 100644 --- a/spec-main/api-browser-view-spec.ts +++ b/spec-main/api-browser-view-spec.ts @@ -27,11 +27,11 @@ describe('BrowserView module', () => { }) afterEach(async () => { + await closeWindow(w) + if (view) { view.destroy() } - - await closeWindow(w) }) describe('BrowserView.destroy()', () => {