test: use webContents.create() in type-safe way (#37281)
test: use (webContents as typeof ElectronInternal.WebContents).create() Co-authored-by: Milan Burda <miburda@microsoft.com>
This commit is contained in:
parent
a44e76fb70
commit
ea848bc1c5
11 changed files with 34 additions and 27 deletions
|
@ -52,7 +52,7 @@ describe('webRequest module', () => {
|
|||
let contents: WebContents = null as unknown as WebContents;
|
||||
// NB. sandbox: true is used because it makes navigations much (~8x) faster.
|
||||
before(async () => {
|
||||
contents = (webContents as any).create({ sandbox: true });
|
||||
contents = (webContents as typeof ElectronInternal.WebContents).create({ sandbox: true });
|
||||
await contents.loadFile(path.join(fixturesPath, 'pages', 'fetch.html'));
|
||||
});
|
||||
after(() => contents.destroy());
|
||||
|
@ -529,7 +529,7 @@ describe('webRequest module', () => {
|
|||
}
|
||||
});
|
||||
|
||||
const contents = (webContents as any).create({
|
||||
const contents = (webContents as typeof ElectronInternal.WebContents).create({
|
||||
session: ses,
|
||||
nodeIntegration: true,
|
||||
webSecurity: false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue