Repository navigation
test: cover all of src/ and require 100% coverage from now on - #136
Merged
Merged
Conversation
johnf
marked this pull request as ready for review
November 25, 2026 01:07
Test what was untested: signing in again with a live session (reusing and widening the grant), refusing tokens for a resource other than the API, the sign-in page and callback error paths, signing out with no session, storage failures inside the provider, the hourly cleanup of expired provider state, REMS failing, an unexpected error while checking a bearer token, admin sign-in failing at the callback, nameless users, crates sharing a label, and an entity listed twice in a page. Remove what no test could reach: guards that only satisfied the types (the grant lookup, the upstream ID token, the first cookie key, the prefix) and the admin sign-in fetch's handling of requests it never makes. The logger's pretty-printing choice becomes a function so its fallback is testable. Thresholds are now a fixed 100% rather than auto-raised, and CLAUDE.md says how to keep it there without writing tests for coverage's sake.
johnf
force-pushed
the
test/full-coverage
branch
from
November 25, 2026 01:12
2c3dda5 to
67ff055
Compare
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.
Coverage of
src/was 98.9% statements / 96.4% branches. It is now 100% on every measure, and the thresholds are a fixed{ 100: true }instead of auto-raised.The gap was mostly real behaviour with no test, not lines needing contrived tests.
Newly tested
invalid_target)stateRemoved rather than tested
idTokenExpectedalready rejects a response without one, now tested), the first cookie key (config requires one; typed as non-empty), the API prefixOne
/* v8 ignore */remains, with its reason: the no-op handler Fastify requires on the routes thathandOffanswers inonRequest.CLAUDE.md now says how to stay at 100% without writing tests just to reach lines.