Metreeca 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 @metreeca/keep.

    testStore covers resource retrieval, CRUD operations, unconditional insert/remove, transaction execution, change notifications, and lifecycle management.

    Connectors call testStore with a StoreTestOptions object that provisions store instances and loads them with the sample dataset.

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

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

    Interfaces

    StoreTestOptions

    Options for running a store conformance suite.

    Type Aliases

    DeepPartial

    A recursively optional view of a resource state.

    StoreTestPatterns

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

    StoreTestScope

    Sub-suite and test selection for a conformance run.

    Functions

    testStore

    Runs the store conformance suite.