Evalkeeper
    Preparing search index...

    Function describeStoreContract

    • The contract every EvalStore must meet. Run it against your store to know the runner will work on it. make must return an empty store each time it's called, unless opts.scope is set: then every suite the contract writes (and every request hash it picks) starts with the scope, the tests never look past their own rows, and opts.cleanup deletes those suites' cases, answers, tests, and outputs afterward, so it can run on a database that holds other rows. opts.without names run settings its tables have no column for; opts.test passes test functions other than Vitest's.

      Parameters

      Returns void

      import { describeStoreContract } from "@crowandraven/evalkeeper/testing";

      describeStoreContract("my store", () => myStore(freshDatabase()));

      // On a database with other rows: only rows starting "contract-" are
      // written, and cleanup deletes only those.
      describeStoreContract("our tables", () => prismaStore(prisma, map), {
      scope: "contract-",
      cleanup: (scope) => deleteScopedRows(prisma, scope, { map }),
      });