2023-10-03 12:16:33 +00:00
|
|
|
import "https://esm.sh/fake-indexeddb@4.0.2/auto";
|
|
|
|
import { DataStore } from "../../plugos/lib/datastore.ts";
|
|
|
|
import { IndexedDBKvPrimitives } from "../../plugos/lib/indexeddb_kv_primitives.ts";
|
|
|
|
import { DataStoreSpacePrimitives } from "./datastore_space_primitives.ts";
|
2023-12-13 16:52:56 +00:00
|
|
|
import { testSpacePrimitives } from "./space_primitives.test.ts";
|
2023-05-23 18:53:53 +00:00
|
|
|
|
2023-10-03 12:16:33 +00:00
|
|
|
Deno.test("DataStoreSpacePrimitives", {
|
|
|
|
sanitizeResources: false,
|
|
|
|
sanitizeOps: false,
|
|
|
|
}, async () => {
|
|
|
|
const db = new IndexedDBKvPrimitives("test");
|
|
|
|
await db.init();
|
|
|
|
|
|
|
|
const space = new DataStoreSpacePrimitives(new DataStore(db));
|
2023-12-13 16:52:56 +00:00
|
|
|
await testSpacePrimitives(space);
|
2023-10-03 12:16:33 +00:00
|
|
|
db.close();
|
2023-05-23 18:53:53 +00:00
|
|
|
});
|