1
0
silverbullet/common/spaces/deno_kv_space_primitives.test.ts
Zef Hemel 9f082c83a9
Major backend refactor (#599)
Backend refactor
2023-12-13 17:52:56 +01:00

13 lines
577 B
TypeScript

import { DenoKvPrimitives } from "../../plugos/lib/deno_kv_primitives.ts";
import { ChunkedKvStoreSpacePrimitives } from "./chunked_datastore_space_primitives.ts";
import { testSpacePrimitives } from "./space_primitives.test.ts";
Deno.test("deno kv test", async () => {
const tempFile = await Deno.makeTempFile({ suffix: ".db" });
const denoKv = new DenoKvPrimitives(await Deno.openKv(tempFile));
const spacePrimitives = new ChunkedKvStoreSpacePrimitives(denoKv, 65536);
await testSpacePrimitives(spacePrimitives);
denoKv.close();
await Deno.remove(tempFile);
});