feat: track script.js in Codecov, fix broken CI badges, add 71 DOM tests#101
Conversation
…URLs Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/ec6867d1-deb4-4888-be4d-aa7fe0c9139c Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/ec6867d1-deb4-4888-be4d-aa7fe0c9139c Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughListen here, fool! This PR separates E2E tests into a dedicated GitHub Actions workflow, removing them from the unit tests workflow. It updates test infrastructure by refactoring the test loader mechanism and expanding integration test coverage. Coverage config and documentation badges also get updated, sucka! Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #101 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 242 242
Branches 109 109
=========================================
Hits 242 242
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|


script.js(the compiled DOM layer) was invisible to Codecov because tests usedeval()instead ofrequire(), and the README badges pointed tounit-tests.yml/e2e-tests.ymlworkflows that didn't exist — only a monolithicci.ymldid.CI / Badge fixes
ci.yml→unit-tests.yml+e2e-tests.ymlso the existing README badge URLs resolve/branch/mainsegmentCoverage tracking for
script.jseval(scriptCode)→jest.resetModules(); require('../script.js')— Istanbul can now instrument the filescript.jstocollectCoverageFrominpackage.jsonscript.js(60% stmts/funcs, 50% branches, 90% lines); kept stricter 80%/70% thresholds ondeath-clock-core.jsLower thresholds for
script.jsreflect reality: it's a minified browser IIFE where ~35% of code paths are gated behindsetInterval/RAF loops,IntersectionObserver, and complex game mechanics that aren't practical to unit-test.Expanded test surface (268 → 339 tests)
Expanded
MIN_HTMLfrom ~20 elements to 130+ elements covering all 22 feature modules, then added 71 new tests across 18 new describe blocks:Coverage after:
death-clock-core.jsscript.jsSummary by CodeRabbit
Tests
Documentation
Chores