test: expand coverage from 13% to 55% with 3,719 tests#254
test: expand coverage from 13% to 55% with 3,719 tests#254smithrashell merged 13 commits intomainfrom
Conversation
…pers, schedule, session assembly
…ice, and retry resilience
…iew, and retry services
…nce, and infrastructure
… already covered by real tests
…tore in afterEach
…icate keys, restricted imports)
PR Review: test: expand coverage from 13% to 55% with 3,719 testsThis is a substantial and well-executed test expansion. The overall direction is correct and the engineering quality is high. Below is detailed feedback organized by category. StrengthsShared Consistent mock-before-import ordering. Good use of factory helpers ( Behavior-level assertions for DB-backed code. Cleanup of dead/skipped tests. Issues and Recommendations1.
|
| Category | Assessment |
|---|---|
| Test architecture | Excellent — real DB approach with proper isolation |
| Coverage improvement | 13% to 55% is a meaningful, verified gain |
| Known production bug | Needs a tracking issue (tag_mastery transaction conflict) |
| Setup correctness | Silent console.error and private _databases API access |
| Schema maintenance | STORES duplication in testDbHelper.js is the largest ongoing risk |
| Coverage thresholds | Should be re-enabled at a minimum floor |
The implementation is solid and moves the project in the right direction. The two highest-priority items before merge are: (1) filing a tracking issue for the calculateTagMastery transaction bug, and (2) considering the schema import consolidation to prevent future drift.
PR Review: test: expand coverage from 13% to 55% with 3,719 testsThis is a substantial PR — 44k lines of new test code across 72 new files. The high-level direction is excellent: moving from brittle mock-based tests to real What is done well
Consistent test structure. The pattern of
Proper cleanup. Issues to address1. Known production bug documented in tests but not fixed
The test works around this by asserting The tests here are measuring survivability of a bug rather than correctness. This should either be fixed in production code or the test should explicitly assert the known-broken behaviour and link to a tracking issue. 2.
|
| Dimension | Assessment |
|---|---|
| Test quality | Good overall; a handful of files have low assertion density for complex functions |
| Architecture | testDbHelper.js shared fixture is the right foundation |
| Production bug | Known but unfixed bug in calculateTagMastery transaction ordering |
| Maintenance | Coverage thresholds should be re-enabled; console.error suppression is too broad |
| Naming | .real.test.js naming is clear but some handler tests do not match the intent |
The PR is a clear net positive for the codebase. The items above — particularly the production bug in calculateTagMastery and the suppressed console.error — should be addressed before merge. The rest are good candidates for follow-up issues.
Generated with Claude Code
…nup, coverage thresholds
PR Review SummaryTwo detailed reviews are already posted above. This comment consolidates the key action items. Must-address before merge1. Production bug in calculateTagMastery The transaction ordering issue — opening a second transaction inside an active readwrite transaction on tag_mastery — is documented in the tests but not fixed in production code. The current tests assert resolves.toBeUndefined() (survivability, not correctness). File a tracking issue and link it to this PR so it is not lost after merge. 2. console.error is fully suppressed in tests In setup.js, the check 3. Coverage thresholds remain commented out With 55% established, re-enable coverageThreshold at a conservative floor (e.g. 50% lines/statements) so future regressions are caught in CI rather than silently landing on main. Good to address in follow-up issues
Overall assessment
The PR is a clear net positive. The three must-address items are the main blockers; the rest are suitable for follow-up issues. Generated with Claude Code |
Summary
.real.test.jsfiles with 3,200+ new tests across all layers (DB stores, services, utilities, background handlers, content services)testDbHelper.jsusing real fake-indexeddb with full 17-store schema, replacing brittle mock-based approachesCloses #252
Test plan
npm test)npm run lint)🤖 Generated with Claude Code