Skip to content

test(replay): add pairFramesStreamed unit tests#20

Merged
protosphinx merged 1 commit into
mainfrom
bot/test-pair-frames-streamed
Jun 9, 2026
Merged

test(replay): add pairFramesStreamed unit tests#20
protosphinx merged 1 commit into
mainfrom
bot/test-pair-frames-streamed

Conversation

@protosphinx

Copy link
Copy Markdown
Member

Why

pairFramesStreamed is the function that powers SSE multi-frame replay (v0.4.1). It is only exercised indirectly by the HTTP integration tests in test/http.sse.test.ts, which spin up a real HTTP server and hit it over the network. A dedicated unit suite lets us verify the pairing logic directly against Frame arrays, covering edge cases the integration test does not reach.

What

  • Add pairFramesStreamed to the import in test/replay.test.ts
  • Add a new describe("pairFramesStreamed") block with 5 focused tests:
    • single response wrapped in a one-element array (non-streaming baseline)
    • multiple response frames collected for one streaming request (progress + result)
    • collection stops at the next outbound request (boundary condition)
    • requests with no responses are excluded from the result
    • server-pushed notifications (no id) are included in the response list

Tests

  • npm test runs all 14 test files; all 158 tests pass including the 5 new ones
  • No source changes, no new dependencies

Self-merge gate

  • all CI checks pass
  • LOC delta < 250 (126 lines added/removed)
  • no public-API surface change
  • no runtime-dependency additions
  • no workflow file changes
  • tests added or extended

Generated by Claude Code

pairFramesStreamed is exercised only through the HTTP integration tests.
Add a dedicated unit suite that covers: single response, multi-frame
streaming (progress + result), boundary at the next outbound request,
requests with no responses being excluded, and server-pushed
notifications (no id) being collected into the response list.
@protosphinx protosphinx added the automated Opened by the daily bot label Jun 9, 2026 — with Claude
@protosphinx protosphinx merged commit d1b20e8 into main Jun 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automated Opened by the daily bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant