refactor: use types for once() return values in spec (#38872)

This commit is contained in:
Milan Burda 2023-06-22 20:38:52 +02:00 committed by GitHub
parent abec9ead06
commit 9226cc662b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 85 additions and 85 deletions

View file

@ -182,7 +182,7 @@ describe('webContents.setWindowOpenHandler', () => {
it('can change webPreferences of child windows', async () => {
browserWindow.webContents.setWindowOpenHandler(() => ({ action: 'allow', overrideBrowserWindowOptions: { webPreferences: { defaultFontSize: 30 } } }));
const didCreateWindow = once(browserWindow.webContents, 'did-create-window');
const didCreateWindow = once(browserWindow.webContents, 'did-create-window') as Promise<[BrowserWindow, Electron.DidCreateWindowDetails]>;
browserWindow.webContents.executeJavaScript("window.open('about:blank', '', 'show=no') && true");
const [childWindow] = await didCreateWindow;