Devflare Docs
Testing Bindings

Test VPC Services the way Devflare expects it to run

VPC service bindings that reach a private service through a Cloudflare VPC connectivity service.

Test VPC Services by choosing the local harness that matches the product boundary instead of reaching for Cloudflare by default.

The first test should prove application control flow. Escalate to Wrangler remote binding or deployed tests only when the Cloudflare-hosted behavior is the thing under test.

Best for
reaching a private upstream service over a Cloudflare VPC connectivity service
Default harness
a deployed or remote-mode test against the real VPC service
Escalate when
The assertion depends on Cloudflare-hosted product behavior rather than the app calling the binding correctly

Start with the default test loop

Keep the first test small. Name the binding, call the one method your route uses, and assert the behavior your app owns.

When Cloudflare owns the interesting behavior, mark that as a remote/deployed lane instead of building a local fake that claims too much.

Test the app flow with a custom VPC fake

The helper surface to remember

  • Use a deployed or remote-mode test against the real VPC service for config-backed local worker tests.
  • Use a custom fake binding injected through for pure unit tests.
  • Use or an explicit integration lane when the test needs Cloudflare credentials or a local Docker/Podman engine.

When to move beyond the default harness

  • Cloudflare owns the VPC connectivity service and the private network path; there is no local simulation because Miniflare only proxies to the remote service.
  • Do not let a low-fidelity mock become product documentation. Keep mocks framed as application-flow tools.
  • If a test would mutate paid or remote Cloudflare state, gate it separately from ordinary unit tests.

Local tests should be honest

For VPC Services, passing locally means the Devflare contract and app flow are correct. It does not automatically prove every hosted Cloudflare behavior.

Previous

VPC Services internals

VPC Services compiles from to Wrangler , with local/test behavior called out explicitly.

Next

VPC Services example

A compact VPC Services recipe with config and worker usage in one application path.