testEachTestHasItsOwnTables

tcmts.server.test.testEachTestHasItsOwnTables · #btk5isls · function

Each test has tables of its own: this one starts with an empty pantry and adds what testTablesCheckTheirRows adds (and leaves), "flour", which unique would refuse were the two sharing rows.

import { pantry } from "#codebase/tcmts/atproto/lib/server/test";
import assert from "node:assert/strict";

export const testEachTestHasItsOwnTables = async () => {
  assert.equal(await pantry.count({}), 0);
  await pantry.insert({ item: "flour", count: 1 });
  assert.equal(await pantry.count({ item: "flour" }), 1);
}

uses