← Back to Throw Joshua Under The Bus

Test Report

Throw Joshua Under The Bus · Thu, 19 Feb 2026 09:25:04 GMT
Commit 45a7525
117
Total Tests
117
Passed
0
Failed
61
Not Covered
Passed 117
Unit Tests 22/22
Positive 19/19
F1.R1 counter file created on startup if missing 290ms
F1.R2 counter file contains valid JSON with count key 228ms
F2.R1 count is a non-negative integer 229ms
F2.R1 initialized counter starts at zero 232ms
F3.R1 atomic writes use tmp + rename pattern 228ms
F3.R2 backup recovery on corrupt file 261ms
F3.R1 backup file is written alongside main file 231ms
F26.R1 feature request saved to disk 285ms
F26.R1 readFeatureRequests returns saved data 229ms
F26.R2 feature request has id, text, and timestamp 156ms
F26.R2 multiple feature requests preserved in order 163ms
F26.R2 feature request uses atomic write (tmp + rename) 160ms
F29.R1 activeUsers map exists and is a Map 216ms
F29.R1 trackUser adds an entry to activeUsers 2ms
F29.R1 trackUser updates lastSeen on repeated calls 1ms
F29.R2 getActiveUserCount returns correct count for active users 1ms
F29.R2 getActiveUserCount returns 0 when no users tracked 0ms
F29.R2 getActiveUserCount excludes stale entries beyond ACTIVE_USER_WINDOW 1ms
F29.R2 getActiveUserCount counts unique IPs only 1ms
Negative 3/3
F3.R2 returns count 0 when both main and backup are missing 232ms
F3.R2 returns count 0 when main is corrupt and backup is also corrupt 258ms
F26.R1 readFeatureRequests returns empty array when file missing 228ms
Integration Tests 49/49
Positive 40/40
F25.R1 POST /api/admin/login with correct credentials succeeds 198ms
F25.R2 GET /api/admin/status returns { authenticated: false } when not logged in 169ms
F25.R2 GET /api/admin/status returns { authenticated: true } when logged in 172ms
F25.R3 POST /api/admin/toggle-action disables throw 178ms
F25.R3 disabled throw returns 403 from POST /api/increment 187ms
F25.R3 disabled guard returns 403 from POST /api/guard 178ms
F25.R3 disabled ambulance returns 403 from POST /api/ambulance 168ms
F25.R3 re-enabling action allows it again 181ms
F25.R3 GET /api/counter includes disabledActions with throw, guard, ambulance 166ms
F15.R1 returns 200 with { count } 212ms
F15.R2 Content-Type is application/json 162ms
F15.R2 body has count and guards fields 181ms
F15.R3 count is a non-negative integer 167ms
F15.R4 reflects count after increments 171ms
F16.R1 increments counter by 1 169ms
F16.R2 returns { count, guards } 187ms
F16.R3 count incremented by 1 172ms
F16.R4 increment persists to disk 251ms
F16.R4 counter starts at 0 246ms
F16.R5 does not require bodyPart field 272ms
F16.R5 succeeds with no request body at all 273ms
F20.R1 adds a guard and returns updated state 223ms
F20.R1 guards accumulate on multiple calls 188ms
F20.R5 throw with active guards consumes a guard instead of incrementing count 183ms
F20.R5 increments count when no guards remain 188ms
F20.R2 guards cannot exceed 10 182ms
F20.R2 guards cap at max 10 from zero 206ms
F20.R3 GET /api/counter reflects decayed guards 188ms
F20.R3 guards decay to zero when enough time passes 181ms
F26.R1 returns empty array when no requests exist 227ms
F26.R1 returns previously submitted requests 196ms
F26.R1 response Content-Type is application/json 199ms
F26.R2 creates a new feature request 183ms
F26.R2 persists request to feature-requests.json file 189ms
F26.R2 trims whitespace from request text 187ms
F21.R1 decrements counter by 1 235ms
F21.R1 returns count and guards in response 196ms
F21.R2 429 response includes retryAfter as a number 195ms
F21.R3 cannot go below 0 192ms
F21.R3 decrementing from 1 results in 0, not negative 196ms
Negative 9/9
F25.R1 POST /api/admin/login with bad credentials returns 401 428ms
F25.R1 POST /api/admin/login with wrong username returns 401 181ms
F25.R1 POST /api/admin/login with missing fields returns 400 198ms
F25.R3 POST /api/admin/toggle-action rejects invalid action 212ms
F25.R3 POST /api/admin/toggle-action requires auth 163ms
F16.R3 returns 429 after exceeding rate limit 500ms
F26.R2 rejects empty text 191ms
F26.R2 rejects missing text field 197ms
F21.R2 returns 429 on cooldown 202ms
Contract Tests 28/28
Positive 23/23
F15.R2 returns 200 with application/json content-type 210ms
F15.R1 response body has count as a number 163ms
F15.R1 response body has guards as a number 174ms
F15.R1 response body has users as a number 173ms
F15.R1 response body has disabledActions object 168ms
F15.R1 count is a non-negative integer 170ms
F15.R1 does not include bodyPartHits or shields fields 195ms
F16.R2 returns 200 with application/json content-type 231ms
F16.R2 response body has count and guards fields 289ms
F16.R2 count is a positive integer after increment from zero 507ms
F16.R2 does not include bodyPartHits or shields fields 163ms
F16.R2 no bodyPart field required in request 166ms
F26.R1 returns 200 with application/json content-type 220ms
F26.R1 response body is an array 170ms
F26.R1 empty array when no feature requests exist 180ms
F26.R2 returns 201 with valid text 177ms
F26.R2 response body has id, text, timestamp, implemented fields 189ms
F26.R2 created request appears in subsequent GET 186ms
F14.R1 returns 200 with text/html content-type 226ms
F14.R2 HTML contains "Throw Joshua Under The Bus" 179ms
F19.R2 GET /features redirects to /features/ 179ms
F19.R3 GET /style.css returns CSS content-type 188ms
F19.R4 GET /script.js returns JavaScript content-type 182ms
Negative 5/5
F15.R1 POST /api/counter is not allowed 158ms
F16.R2 GET /api/increment is not allowed 162ms
F26.R2 returns 400 when text is missing 184ms
F26.R2 returns 400 when text is empty string 182ms
F19.R1 GET /nonexistent-file.xyz returns 404 186ms
Functional Tests 18/18
F21.R1 Ambulance button is visible 264ms
F21.R2 Ambulance button shows cooldown after use 913ms
F7.R1 Page loads with counter display visible 185ms
F7.R2 Counter shows a number 191ms
F8.R1 Joshua doll SVG is visible 207ms
F9.R1 Clicking Joshua triggers throw 234ms
F10.R1 Counter increments after throw 726ms
F26.R1 Feature request form is visible on /feature-requests/ 158ms
F26.R2 Submitting a feature request works 1.7s
F20.R1 Guard button is visible 194ms
F20.R2 Clicking guard adds guards 350ms
F20.R3 Guard display shows count 575ms
F14.R1 Homepage has title "Throw Joshua Under The Bus" 213ms
F14.R2 Page has nav tabs visible 152ms
F19.R1 Features page accessible at /features/ 187ms
F19.R2 Releases page accessible at /releases/ 154ms
F19.R3 Feature requests page accessible at /feature-requests/ 147ms
F19.R4 Admin page accessible at /admin/ 124ms
All tests passed