Skip to content

test: version-agnostic SARIF fixture + observer server/screencast coverage#48

Merged
xcodethink merged 1 commit into
mainfrom
test/observer-and-sarif-followups
Jun 2, 2026
Merged

test: version-agnostic SARIF fixture + observer server/screencast coverage#48
xcodethink merged 1 commit into
mainfrom
test/observer-and-sarif-followups

Conversation

@xcodethink

Copy link
Copy Markdown
Owner

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.version neutralized to a sentinel before comparing (SARIF schema version untouched); gen-sarif-fixture.ts writes 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: startScreencast against 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 in src/observer/server.ts include the query string in their url === 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

…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>
@xcodethink xcodethink merged commit bb25b62 into main Jun 2, 2026
9 of 11 checks passed
@xcodethink xcodethink deleted the test/observer-and-sarif-followups branch June 2, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant