test: add integrations, cache, cron, and telemetry tests

- New integrations.test.ts: 13 tests covering CRUD, token generation,
  token lookup, regeneration, and multi-user isolation
- New cache.test.ts: 3 tests for purgeMetadataCache (shell title
  deletion, fully-fetched title preservation, empty case)
- New cron.test.ts: 5 tests for cron run lifecycle (start, complete,
  fail with Error and string)
- New telemetry.test.ts: 7 tests for isTelemetryEnabled toggle and
  performTelemetryReport (disabled skip, enabled send, 24h interval
  throttle, interval expiry, fetch failure resilience)

345 → 386 tests passing across 27 files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 12:39:04 -04:00
co-authored by Claude Opus 4.6
parent 554271a888
commit 373a5d3caf
16 changed files with 402 additions and 61 deletions
+1 -1
View File
@@ -391,7 +391,7 @@ describe("processImportJob — state transitions", () => {
createdAt,
})
.run(),
).toThrow();
).toThrow("UNIQUE constraint");
testDb.update(importJobs).set({ status: "success" }).where(eq(importJobs.id, "job-1")).run();