Add comprehensive test suite with CI workflow

- 211 tests across 15 files covering services (tracking, discovery,
  metadata, backup, credits, webhooks, settings, update-check, colors,
  person), utilities (config, cron, providers, title-theme), and TMDB
  image URL helpers
- `lib/test-preload.ts` + `bunfig.toml` wire up a global in-memory
  SQLite DB with migrations for all DB-backed tests
- `lib/test-utils.ts` provides `clearAllTables()` and seed helpers
  (insertUser, insertTitle, insertTvShow, insertMovieWatch, etc.)
- Export `getBackupSource`, `isKnownBackup`, `isValidBackupFilename`,
  `buildBackupCron`, `performUpdateCheck` internals for direct testing
- GitHub Actions workflow runs `bun test --coverage` on push/PR to main
This commit is contained in:
jake committed 2026-03-06 13:42:58 -05:00
1 parent 965e8353ac
commit 4cf326fa00
25 files changed
+2737 -9

No files matched your search

+2
View File
@@ -9,6 +9,8 @@
"lint": "biome check",
"format": "biome format --write",
"check-types": "tsc --noEmit",
"test": "bun test",
"test:coverage": "bun test --coverage",
"db:generate": "bun --bun drizzle-kit generate",
"db:migrate": "bun --bun drizzle-kit migrate",
"db:push": "bun --bun drizzle-kit push",