mirror of
https://github.com/bretzel-app/crumbs.git
synced 2026-10-12 12:06:57 +02:00
14 lines
338 B
TypeScript
14 lines
338 B
TypeScript
import { existsSync, unlinkSync } from 'fs';
|
|
|
|
const TEST_DB = './data/test-crumbs.db';
|
|
|
|
export default function globalSetup() {
|
|
// Clean test database before E2E run so each run starts fresh
|
|
for (const ext of ['', '-journal', '-wal', '-shm']) {
|
|
const path = `${TEST_DB}${ext}`;
|
|
if (existsSync(path)) {
|
|
unlinkSync(path);
|
|
}
|
|
}
|
|
}
|