feat: implement esting suite using Vitest and add to ci

This commit is contained in:
Your Name
2026-04-12 13:38:40 +05:30
parent b5eaf8f476
commit 118a73d4aa
10 changed files with 287 additions and 21 deletions
+17
View File
@@ -0,0 +1,17 @@
import "@testing-library/jest-dom";
import { IDBFactory } from "fake-indexeddb";
import { afterAll, afterEach, beforeAll } from "vitest";
import { server } from "./mocks/server";
/**
* faking indexeddb in memory for testing crypto key storage
*/
Object.defineProperty(globalThis, "indexedDB", {
value: new IDBFactory(),
writable: true,
configurable: true,
});
beforeAll(() => server.listen({ onUnhandledRequest: "warn" }));
afterEach(() => server.resetHandlers());
afterAll(() => server.close());