Harden non-streaming fallback tests for fetchWithCorsProxy - #3495
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Strengthens the “non-streaming fallback” test suite for fetchWithCorsProxy by deterministically forcing supportsReadableStreamBody() to report “unsupported”, ensuring tests actually exercise the intended fallback path.
Changes:
- Added a
__testing.setStreamBodySupported(false)hook to force non-streaming mode in tests. - Updated the non-streaming fallback test setup to assert the forced mode and simplified fetch mock ordering/call counts accordingly.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/php-wasm/web-service-worker/src/utils.ts | Adds a test-only setter to control the cached supportsReadableStreamBody() result. |
| packages/php-wasm/web-service-worker/src/fetch-with-cors-proxy.spec.ts | Forces non-streaming mode in beforeEach and updates mocks/assertions to match the new deterministic behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ashfame
marked this pull request as draft
April 16, 2026 18:53
ashfame
force-pushed
the
fix/non-streaming-fallback-tests
branch
from
July 16, 2026 11:18
5215568 to
7e0502e
Compare
ashfame
marked this pull request as ready for review
July 16, 2026 11:22
brandonpayton
approved these changes
Jul 17, 2026
Member
|
@ashfame Thanks for faithfully following up on prior PR review comments. Let's merge this! |
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
Follow-up to #3440, specifically addressing Brandon's comments the request to assert unsupported streaming in each fallback test and the concern that resetting the cache allows Node.js/V8 to detect streaming support.
supportsReadableStreamBody()result tofalseinbeforeEach()and asserts that value before every test runs.afterEach(), keeping the test state hermetic.Test plan
npm exec nx test php-wasm-web-service-worker --testFile=fetch-with-cors-proxy.spec.tsnpm exec nx lint php-wasm-web-service-worker