@grafctory/keep
    Preparing search index...

    Connector conformance test suite.

    Provides reusable test suites that backend connector packages run to verify their Store implementations satisfy the contracts defined by @grafctory/keep.

    testStore covers resource and collection retrieval, conditional and unconditional writes, transaction execution, mutation events, and lifecycle management.

    Connectors call testStore with a StoreTestOptions object that provisions store instances and loads them with the sample dataset. The suite states no retrieval scope on its lookups, so each store it opens MUST take a default scope open to linked resources, whole collections and aggregates, as in the example.

    import { testStore } from "@grafctory/keep-suite";
    import { describe } from "vitest";

    describe("my-connector", () => testStore({
    open: () => createMyStore({ scope: { stats: true, depth: Infinity, limit: Infinity } }),
    contains: (id) => myStoreExists(id),
    includes: (resource, shape) => myStoreIncludes(resource, shape),
    excludes: (resource, shape) => myStoreExcludes(resource, shape),
    populate: () => myStorePopulate(),
    generate: (resource, shape) => myStoreGenerate(resource, shape)
    }));
    StoreTestOptions

    Options for running a store conformance suite.

    Probe

    Fact probe accepted for a resource shape.

    StoreTestPatterns

    Sub-suite or test selector pattern accepted by target and ignore.

    StoreTestScope

    Sub-suite and test selection for a conformance run.

    testStore

    Runs the store conformance suite.