chore: migrate api-web-frame-spec.ts to vitest

This commit is contained in:
Samuel Attard
2026-04-11 23:00:25 -07:00
parent 2e7aaacbbe
commit d2a5c72b5f

View File

@@ -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;
});