Bootstrap a per-run test database (ensure, push schema, truncate, seed baselines, repair sequences), wire vitest/playwright globals, and gate schema push behind DB_PUSH. Serial test files share the one database. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
14 lines
486 B
TypeScript
14 lines
486 B
TypeScript
import { resolveTestDatabaseUri, truncateAllData } from "./test-db";
|
|
|
|
/**
|
|
* Vitest global teardown: leave the test database empty after the run. The
|
|
* next run truncates again anyway, so this is hygiene, not correctness:
|
|
* failures here must never fail the suite.
|
|
*/
|
|
export default async function globalTeardown(): Promise<void> {
|
|
try {
|
|
await truncateAllData(resolveTestDatabaseUri());
|
|
} catch (error) {
|
|
console.warn("[test-db] teardown truncate failed:", error);
|
|
}
|
|
}
|