mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
chore: migrate api-web-frame-spec.ts to vitest
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { BrowserWindow, ipcMain, WebContents } from 'electron/main';
|
||||
|
||||
import { expect } from 'chai';
|
||||
import { afterAll, beforeAll, describe, it } from 'vitest';
|
||||
|
||||
import { once } from 'node:events';
|
||||
import * as path from 'node:path';
|
||||
@@ -77,7 +78,7 @@ describe('webFrame module', () => {
|
||||
describe('api', () => {
|
||||
let w: WebContents;
|
||||
let win: BrowserWindow;
|
||||
before(async () => {
|
||||
beforeAll(async () => {
|
||||
win = new BrowserWindow({ show: false, webPreferences: { contextIsolation: false, nodeIntegration: true } });
|
||||
await win.loadURL('data:text/html,<iframe name="test"></iframe>');
|
||||
w = win.webContents;
|
||||
@@ -89,7 +90,7 @@ describe('webFrame module', () => {
|
||||
`);
|
||||
});
|
||||
|
||||
after(() => {
|
||||
afterAll(() => {
|
||||
win.close();
|
||||
win = null as unknown as BrowserWindow;
|
||||
});
|
||||
Reference in New Issue
Block a user