mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
test: cleanup let xyz = null as unknown as T; (#37335)
This commit is contained in:
@@ -70,7 +70,7 @@ function defer (): Promise<any> & {resolve: Function, reject: Function} {
|
||||
}
|
||||
|
||||
describe('protocol module', () => {
|
||||
let contents: WebContents = null as unknown as WebContents;
|
||||
let contents: WebContents;
|
||||
// NB. sandbox: true is used because it makes navigations much (~8x) faster.
|
||||
before(() => { contents = (webContents as typeof ElectronInternal.WebContents).create({ sandbox: true }); });
|
||||
after(() => contents.destroy());
|
||||
@@ -824,7 +824,7 @@ describe('protocol module', () => {
|
||||
const imageURL = `${origin}/test.png`;
|
||||
const filePath = path.join(fixturesPath, 'pages', 'b.html');
|
||||
const fileContent = '<img src="/test.png" />';
|
||||
let w: BrowserWindow = null as unknown as BrowserWindow;
|
||||
let w: BrowserWindow;
|
||||
|
||||
beforeEach(() => {
|
||||
w = new BrowserWindow({
|
||||
@@ -900,7 +900,7 @@ describe('protocol module', () => {
|
||||
});
|
||||
|
||||
describe('protocol.registerSchemesAsPrivileged cors-fetch', function () {
|
||||
let w: BrowserWindow = null as unknown as BrowserWindow;
|
||||
let w: BrowserWindow;
|
||||
beforeEach(async () => {
|
||||
w = new BrowserWindow({ show: false });
|
||||
});
|
||||
@@ -1005,7 +1005,7 @@ describe('protocol module', () => {
|
||||
const pagePath = path.join(fixturesPath, 'pages', 'video.html');
|
||||
const videoSourceImagePath = path.join(fixturesPath, 'video-source-image.webp');
|
||||
const videoPath = path.join(fixturesPath, 'video.webm');
|
||||
let w: BrowserWindow = null as unknown as BrowserWindow;
|
||||
let w: BrowserWindow;
|
||||
|
||||
before(async () => {
|
||||
// generate test video
|
||||
|
||||
Reference in New Issue
Block a user