You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CLAUDE ROUTINE]: Test-coverage enhancement — add unit tests for src/auth/ and src/relay/ modules #155
The newly-added cloud platform client (login / logout / token-store + relay daemon + queue + pid) currently has no files under __tests__/. Adding focused unit tests for these modules catches regressions early and lets us evolve the cloud path confidently.
Where
Source with no direct unit tests:
src/auth/login.ts (104 lines) — device-code flow, polling loop, browser open
Existing __tests__/hooks/ is well-covered; the gap is entirely on the cloud side.
Why this helps
The OAuth device flow has a handful of branches (no browser, timeout, network failure, wrong code) that are easy to cover and hard to reason about without tests.
token-store.ts already does atomic writes correctly — a unit test pins that behaviour so a future refactor doesn't regress it.
queue.ts has the most user-visible correctness surface (sanitization, queue size caps, claim/ack) and ships with zero coverage today.
Relay daemon tests let us exercise reconnect / backoff / ack paths without running a real server — well worth the small test harness investment.
Proposed scope
Create these test files (all using the existing vitest harness):
__tests__/auth/token-store.test.ts
atomic write + read roundtrip
writeTokens with existing file (atomic replace, not clobber)
clearTokens deletes file; readTokens on missing file returns null
Activity