test: move resetDb to own testing lib function
This commit is contained in:
11
src/libs/test/resetTestDb.ts
Normal file
11
src/libs/test/resetTestDb.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { tables } from "~/models/schema";
|
||||
|
||||
import { getTestDb } from "./getTestDb";
|
||||
|
||||
export async function resetTestDb() {
|
||||
const db = getTestDb();
|
||||
|
||||
for (const table of tables) {
|
||||
await db.delete(table);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user