mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
chore: migrate security-warnings-spec.ts to vitest
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { BrowserWindow, WebPreferences } from 'electron/main';
|
||||
|
||||
import { expect } from 'chai';
|
||||
import { afterAll, afterEach, beforeAll, describe, it } from 'vitest';
|
||||
|
||||
import * as fs from 'node:fs/promises';
|
||||
import * as http from 'node:http';
|
||||
@@ -25,7 +26,7 @@ describe('security warnings', () => {
|
||||
let useCsp = true;
|
||||
let serverUrl: string;
|
||||
|
||||
before(async () => {
|
||||
beforeAll(async () => {
|
||||
// Create HTTP Server
|
||||
server = http.createServer(async (request, response) => {
|
||||
const uri = new URL(request.url!, `http://${request.headers.host}`).pathname!;
|
||||
@@ -51,7 +52,7 @@ describe('security warnings', () => {
|
||||
serverUrl = `http://localhost2:${(await listen(server)).port}`;
|
||||
});
|
||||
|
||||
after(() => {
|
||||
afterAll(() => {
|
||||
// Close server
|
||||
server.close();
|
||||
server = null as unknown as any;
|
||||
Reference in New Issue
Block a user