-
-
Notifications
You must be signed in to change notification settings - Fork 4
chore: use isolated test database instead of dev DB #275
Copy link
Copy link
Open
Description
Problem
All unit tests currently use getDb() which connects to the development database (data/dm-hero.db). While tests create their own campaigns and clean up after themselves, this is risky - a bug in cleanup could corrupt dev data.
Solution
Create a getTestDb() utility that:
- Creates a separate in-memory or temp-file SQLite database
- Runs all migrations on it
- Returns the isolated DB instance
Then migrate all existing test files to use getTestDb() instead of getDb().
Files affected
All files in packages/app/test/unit/ that import getDb from server/utils/db.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels