mirror of
https://github.com/electron/electron.git
synced 2026-01-08 15:13:52 -05:00
test: use await to call "closeWindow" (#38166)
* test: wait for an async "closeWindow" call * fixup! test: wait for an async "closeWindow" call
This commit is contained in:
@@ -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 });
|
||||
|
||||
@@ -559,9 +559,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 () => {
|
||||
|
||||
Reference in New Issue
Block a user