mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
chore: migrate api-ipc-renderer-spec.ts to vitest
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ipcMain, BrowserWindow } from 'electron/main';
|
||||
|
||||
import { expect } from 'chai';
|
||||
import { afterAll, beforeAll, describe, it } from 'vitest';
|
||||
|
||||
import { once } from 'node:events';
|
||||
|
||||
@@ -8,7 +9,7 @@ import { closeWindow } from './lib/window-helpers';
|
||||
|
||||
describe('ipcRenderer module', () => {
|
||||
let w: BrowserWindow;
|
||||
before(async () => {
|
||||
beforeAll(async () => {
|
||||
w = new BrowserWindow({
|
||||
show: false,
|
||||
webPreferences: {
|
||||
@@ -20,7 +21,7 @@ describe('ipcRenderer module', () => {
|
||||
await w.loadURL('about:blank');
|
||||
w.webContents.on('console-message', (_event, ...args) => console.error(...args));
|
||||
});
|
||||
after(async () => {
|
||||
afterAll(async () => {
|
||||
await closeWindow(w);
|
||||
w = null as unknown as BrowserWindow;
|
||||
});
|
||||
Reference in New Issue
Block a user