Skip to content

Commit

Permalink
test: use await to call "closeWindow" (#38171)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykuzmin committed May 4, 2023
1 parent a4ac36f commit c9e5917
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion spec/api-web-contents-view-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { BaseWindow, WebContentsView } from 'electron/main';

describe('WebContentsView', () => {
let w: BaseWindow;
afterEach(() => closeWindow(w as any).then(() => { w = null as unknown as BaseWindow; }));

afterEach(async () => {
await closeWindow(w as any);
w = null as unknown as BaseWindow;
});

it('can be used as content view', () => {
w = new BaseWindow({ show: false });
Expand Down
5 changes: 3 additions & 2 deletions spec/extensions-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,10 @@ describe('chrome extensions', () => {
});
});

afterEach(() => {
afterEach(async () => {
removeAllExtensions();
return closeWindow(w).then(() => { w = null as unknown as BrowserWindow; });
await closeWindow(w);
w = null as unknown as BrowserWindow;
});

it('should run content script at document_start', async () => {
Expand Down

0 comments on commit c9e5917

Please sign in to comment.