test: remove a few casts to any (#39713)

This commit is contained in:
Milan Burda 2023-09-05 04:22:41 +02:00 committed by GitHub
parent c5b20eeb13
commit d76a35afe4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 29 additions and 21 deletions

View file

@ -2012,13 +2012,13 @@ describe('chromium features', () => {
const w = new BrowserWindow({ show: false });
await w.loadFile(path.join(fixturesPath, 'pages', 'blank.html'));
// History should have current page by now.
expect((w.webContents as any).length()).to.equal(1);
expect(w.webContents.length()).to.equal(1);
const waitCommit = once(w.webContents, 'navigation-entry-committed');
w.webContents.executeJavaScript('window.history.pushState({}, "")');
await waitCommit;
// Initial page + pushed state.
expect((w.webContents as any).length()).to.equal(2);
expect(w.webContents.length()).to.equal(2);
});
});
@ -2038,7 +2038,7 @@ describe('chromium features', () => {
once(w.webContents, 'did-navigate-in-page')
]);
(w.webContents as any).once('navigation-entry-committed', () => {
w.webContents.once('navigation-entry-committed' as any, () => {
expect.fail('Unexpected navigation-entry-committed');
});
w.webContents.once('did-navigate-in-page', () => {
@ -2046,7 +2046,7 @@ describe('chromium features', () => {
});
await w.webContents.mainFrame.frames[0].executeJavaScript('window.history.back()');
expect(await w.webContents.executeJavaScript('window.history.state')).to.equal(1);
expect((w.webContents as any).getActiveIndex()).to.equal(1);
expect(w.webContents.getActiveIndex()).to.equal(1);
});
});
});