test: version-agnostic SARIF fixture + observer server/screencast coverage#48
Merged
Merged
Conversation
…ast coverage Two test follow-ups (no production-code changes): #1 — Stop the SARIF golden fixture needing a per-release version bump. - wcag-axe.test.ts: neutralize the tool `driver.version` to a sentinel on BOTH generated + committed SARIF before comparing (the SARIF schema version is untouched). A version bump no longer breaks the byte-identical check. - gen-sarif-fixture.ts writes the same sentinel so regen stays consistent; fixture pinned to "0.0.0-fixture". #3 — Cover the observer's HTTP/WS server + CDP screencast (were 0.78% / 6.66%). - tests/observer-server.test.ts: real localhost ObserverServer (ephemeral port, no browser) — dashboard/grid routes, /api/grid + /api/session, token auth (401/200), data routes, 404s, and WS (bad-token 4001, init payload, command dispatch to the bus, binary frame broadcast, event relay). - tests/observer-screencast.test.ts: startScreencast against a fake CDP — defaults/custom options, frame forwarding + ack, timestamp fallback, stop() teardown, and the CDP-unavailable no-op path. Found while testing (flagged, NOT changed here — it's a routing quirk in src/observer/server.ts): the exact-match `/api/{state,events,timeline}` routes include the query string in their `url ===` check, so they only resolve with header auth, not `?token=`. Documented in the test; worth a follow-up. Verified: tsc clean, lint 0 problems, 19/19 new tests pass (stable x3). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
Two test-only follow-ups from the post-1.3.0 'known issues, which are fixable?' review (items ① and ③).
① SARIF golden fixture no longer needs a per-release version bump
The byte-identical SARIF test broke on every version bump (golden pinned the old version). Now both generated + committed SARIF have their tool
driver.versionneutralized to a sentinel before comparing (SARIF schema version untouched);gen-sarif-fixture.tswrites the same sentinel.③ Observer HTTP/WS server + CDP screencast coverage (were 0.78% / 6.66%)
observer-server.test.ts: real localhost server (ephemeral port, no browser) — routes, token auth, 404s, and WS (bad-token 4001, init payload, command dispatch, binary frame broadcast, event relay).observer-screencast.test.ts:startScreencastagainst a fake CDP — options, frame forward + ack, stop teardown, CDP-unavailable no-op.No production-code changes.
Found while testing (flagged, not changed): the exact-match
/api/{state,events,timeline}routes insrc/observer/server.tsinclude the query string in theirurl ===check, so they only resolve with header auth, not?token=. Documented in the test; candidate for a follow-up fix.Verified locally: tsc clean, lint 0 problems, 19/19 new tests pass (stable ×3).
🤖 Generated with Claude Code