[wrangler] fix: update remote proxy session error test snapshots#13935
Conversation
PR #11896 enriched the error thrown by startRemoteProxySession but updated test expectations to a 'Failed to create a preview token' regex that does not match the actual surfaced message ('Error reloading remote server: A request to the Cloudflare API ... failed.'), regressing two real-API tests. - fixtures/get-platform-proxy-remote-bindings: switch back to toMatchInlineSnapshot with the current literal message. - packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts: capture via try/catch and assert against normalizeOutput so the real account id is normalized in the snapshot.
|
|
Codeowners approval required for this PR:
Show detailed file reviewers |
|
Review posted successfully on PR #13935. The main feedback is about the try/catch pattern in the e2e tests — if the function under test stops throwing, |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
Fixes the test regression introduced by #11896, which enriched the error thrown by
startRemoteProxySessionbut pointed two real-API tests at a regex (Failed to create a preview token) that does not match the message that actually surfaces in CI:This PR updates the two tests that exercise real API calls so their assertions reflect the actual error string:
fixtures/get-platform-proxy-remote-bindings/tests/index.test.ts— back totoMatchInlineSnapshot(the invalid account id is a hard-coded literal here, so no normalization needed).packages/wrangler/e2e/remote-binding/remote-bindings-api.test.ts— capture viatry/catchand assert againstnormalizeOutput(...)so the realCLOUDFLARE_ACCOUNT_IDis normalized in the snapshot.The mocked unit test in
packages/wrangler/src/__tests__/dev/remote-bindings-errors.test.tsand the loosely-assertingpackages/vite-plugin-cloudflare/e2e/remote-bindings.test.tsare unaffected and were left alone.A picture of a cute animal (not mandatory, but encouraged)