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 }),
});
The contract every EvalStore must meet. Run it against your store to know the runner will work on it.
makemust return an empty store each time it's called, unlessopts.scopeis 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, andopts.cleanupdeletes those suites' cases, answers, tests, and outputs afterward, so it can run on a database that holds other rows.opts.withoutnames run settings its tables have no column for;opts.testpasses test functions other than Vitest's.