mirror of
https://github.com/ramvignesh-b/pi-ku.git
synced 2026-05-04 08:56:52 +00:00
feat: implement esting suite using Vitest and add to ci
This commit is contained in:
@@ -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());
|
||||
Reference in New Issue
Block a user