feat: Priority 4 — test completeness#13
Merged
Merged
Conversation
- Add formatTokenCountShort small-number test in death-clock.test.js covering the previously-uncovered line 251 - Add browser window export test via vm.runInNewContext (lines 443-444 are browser-only dead code in Jest's Node env; behaviour verified) - Add tests/script.test.js: jsdom integration/smoke tests for script.js DOM logic (renderMilestones, renderPredictionsTable, renderScoring, theme toggle, scoring toggle, updateCounters, getCurrentTokens growth, initChart, escHtml) - Mark Priority 4 items as done in README.md - Test count: 75 → 99, all passing; coverage 96% → 97% statements Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/29387211-2b38-4246-a16e-ce7f3d18128e Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
nitrocode
April 14, 2026 13:47
View session
nitrocode
approved these changes
Apr 14, 2026
Contributor
👁️ PR Preview
|
- Remove 'Prompt & PR Quality Score' section from index.html - Remove PROMPT_SCORING, computePromptScore from death-clock-core.js - Remove renderScoring(), initScoringToggle() from script.js - Fix CI test failures: add DOMContentLoaded fallback in loadScript() so tests pass regardless of jsdom readyState at eval() time - Add formatTokenCountShort quintillion branch test (covers new branch) - Remove scoring-related tests from both test files - Coverage: branches 91.91% -> 93.68%, statements 97.19% -> 97.89% - Tests: 99 -> 91 (8 scoring tests removed) Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/9f382abf-841e-4725-84f2-0e008f9600ea Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
nitrocode
approved these changes
Apr 21, 2026
init() now calls initLifeBlocks() which registers requestAnimationFrame(lbUpdateFrame) before requestAnimationFrame(updateCounters). Capturing mock.calls[0] returned the wrong callback; mock.calls.at(-1) always gets updateCounters regardless of how many earlier RAF registrations exist. Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/a0cc2007-2a00-4639-9c16-fc1d788bb684 Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
initLifeBlocks()(merged from main/PR#14) registersrequestAnimationFrame(lbUpdateFrame)beforerequestAnimationFrame(updateCounters)insideinit(), so the oldmock.calls[0]was capturinglbUpdateFrameinstead ofupdateCountersloadScript()intests/script.test.js: changemock.calls[0]tomock.calls.at(-1)so it always captures the last-registered RAF callback (updateCounters)