chore: migrate security-warnings-spec.ts to vitest

This commit is contained in:
Samuel Attard
2026-04-11 23:01:42 -07:00
parent 6d99359799
commit b1f3befe21

View File

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