test: add SSE stream test coverage for /api/check/stream (#193)#271
Open
schmug wants to merge 1 commit into
Open
test: add SSE stream test coverage for /api/check/stream (#193)#271schmug wants to merge 1 commit into
schmug wants to merge 1 commit into
Conversation
Adds test/api-check-stream.test.ts (17 tests) and test/helpers/drain-sse.ts covering the happy path, error path, DKIM custom selectors, and stream ordering. Also fixes a latent bug: the done event writeSSE was not awaited in the live-scan path, causing it to be lost before stream.close() ran. https://claude.ai/code/session_01PWjVsDVDNFjWvdMmwVFGdT
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
dmarcheck | a8cf469 | May 14 2026, 01:24 PM |
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.
Summary
test/api-check-stream.test.ts(17 tests) andtest/helpers/drain-sse.tscovering the SSE framing contract forGET /api/check/streamstream.writeSSE({ event: "done", ... })was not awaited in the live-scan path, causing the terminal event to be dropped beforestream.close()ran — the tests surfaced this and the fix is a one-lineawaitaddition insrc/index.tsdrainSSE(response)helper is reusable for future SSE testsTest plan
npx vitest run test/api-check-stream.test.tsnpm run typecheck— cleannpm run lint— cleantext/event-stream, 7 protocol events (one per protocol ID), onedoneevent last, no duplicates, all data is valid JSONselectors=custom1,custom2increases the "+N more not found" count by exactly 2protocolevents precede thedoneevent; two sequential scans both completeCloses #193
https://claude.ai/code/session_01PWjVsDVDNFjWvdMmwVFGdT