mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-27 05:38:09 -05:00
18 lines
668 B
TypeScript
18 lines
668 B
TypeScript
import { resetFactories } from "~/db/seed/core/defineFactory";
|
|
import { deleteAllRows } from "~/db/wipe";
|
|
import { markDatabaseClean } from "~/db/write-tracker";
|
|
import { clearAllTournamentDataCache } from "~/features/tournament-bracket/core/Tournament.server";
|
|
|
|
/**
|
|
* Deletes all rows except migration bookkeeping. `app/test-setup.ts` runs it after every writing
|
|
* vitest test and the e2e reset fixture before every test; call by hand only to wipe *within* a test.
|
|
*/
|
|
export const dbReset = async () => {
|
|
await deleteAllRows();
|
|
|
|
resetFactories();
|
|
clearAllTournamentDataCache();
|
|
// last, because the deletes above are themselves writes
|
|
markDatabaseClean();
|
|
};
|