#199
fix(testing): preserve no-content responses in fixture helpers
Fixes #197.
I preserved an absent response body when fixture recording and replay reconstruct HTTP 204, 205, or 304. Previously, replay serialized null as a body and recording passed an empty string; both threw in the Response constructor before the connector could inspect the status.
Regression coverage exercises all three statuses, null and empty fixture representations, record→replay, status/header preservation, and credential-header filtering. A 200 JSON-null response remains a payload. No fixture schema or transport ABI changes are needed.
Validation (Deno 2.9.7):
- Both no-content regressions fail before the fix. Fixture suite: 13 passed, 0 failed.
- All 251 test modules imported into one temporary shared-process entry point: 1,301 passed, 0 failed, 221 gated live tests ignored. This is not a standard isolated-module
deno task testrun. deno task check,deno task lint, changed-filedeno fmt --check,git diff --check, anddeno task version:check --base upstream/mainpass.
@ooctoo777, could you review and merge this fix?
Summary by CodeRabbit
- Bug Fixes
- Recorded and replayed responses with status codes 204, 205, and 304 now correctly have no body, including when fixtures contain a null or empty body.
- Responses with status 200 continue to preserve JSON
nullas a body.
No actionable comments were generated in the recent review.
ad100ee5-f3ff-4b3d-9f96-15153aaf7ce5Reviewing files that changed from the base of the PR and between 09d54479142e36eff876383beacfbd37b33b5908 and b4e9754ba34c1ff9f2ff8e590cb161ac2463c5f6.
shared/testing/fixture-size.test.tsshared/testing/fixtures.tsIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Walkthrough
replayFetchandrecordingFetchnow construct responses with null bodies for statuses 204, 205, and 304. Tests verify status and header handling, empty response bodies, and that a JSONnullpayload remains a body for status 200.Priority: Normal
Severity of issue fixed: Medium
Merge Risk: Minimal · up to
b4e97The fixture change appears ready to merge after normal checks; no actionable remaining risk was identified.
Pre-merge checks: 4
#197requires bodyless reconstruction for statuses 204, 205, and 304.replayFetchnow passesnullfor those statuses, including fixtures withnulland empty-string bodies.recordingFetch…#170is inc…Full details: Linked Issues check
Explanation
Issue
#197requires bodyless reconstruction for statuses 204, 205, and 304.replayFetchnow passesnullfor those statuses, including fixtures withnulland empty-string bodies.recordingFetchalso passesnullfor those statuses. The tests cover all three statuses, record-to-replay, allowlisted headers, credential-header filtering, and a status-200 JSONnullpayload.Full details: Out of Scope Changes check
Explanation
The diff changes only fixture reconstruction and its regression tests. The changes preserve existing headers and ordinary response-body behavior. No binary or multipart transport work from
#170is included.Comment
@coderabbitai helpto get the list of available commands.