cloudflare / cloudflare/sandbox-sdk
Add E2E test coverage for preview URL routing
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 114
- Avg merge
- 22h 42m
- Merged PRs (30d)
- 14
Description
The `proxyToSandbox()` → `sandbox.fetch()` path (preview URL routing for WebSocket upgrades) has no E2E test coverage. A `this` binding bug in the `getSandbox()` proxy went undetected because:
- Unit tests mock the stub, so `this` binding issues don't manifest
- Existing WebSocket E2E tests use `wsConnect()` (already in `enhancedMethods`), not preview URLs
A unit test for the proxy contract has been added, but an E2E test that actually hits a preview URL would catch routing, token validation, and port switching issues end-to-end.
**Blocked on**: The E2E test worker runs on `.workers.dev` which doesn't support `exposePort()`. The test infrastructure needs a custom domain with wildcard DNS before this test can be added.
Contributor guide
Assessment
This issue has not been assessed yet.