Devflare Docs
Testing Devflare

Document every public helper by the smallest useful use

Use this reference when you know you need the test package but not which helper surface is the smallest truthful proof.

The entrypoint intentionally has multiple lanes: runtime-shaped tests, direct event helpers, pure mocks, offline envs, remote-boundary guards, and Docker/Podman-gated container helpers.

Best for
Choosing and importing test helpers
Default import
Cleanup

Helper map

Export familySmallest useStatus
, , Runtime-shaped Worker tests with cleanup.Recommended
, , , , Trigger the matching Worker surface directly.Recommended
, , , , Direct helper modules behind the unified API.Advanced
, , , Pure config-derived binding fixtures without runtime startup.Recommended for offline-first unit tests
, , , , Small pure unit tests without Miniflare.Recommended when runtime dispatch is irrelevant
, , , Pure fixture for one platform-shaped binding.Recommended
, , , Call-shape tests for platform-owned products.Boundary-aware
, , , AI Search mocksDeterministic local tests for product-shaped APIs.Boundary-aware
Skip remote, paid, or dependency-heavy checks clearly.Recommended for CI
, , , , Docker/Podman-gated local container tests.Integration lane
, , Service-binding and cross-worker DO resolution internals.Advanced/internal

Exact value export index

ExportUse
Boot the nearest Devflare config in the test harness.
Read bindings and call in harness tests.
Unified Worker, queue, scheduled, email, and tail trigger API.
Direct Worker fetch helper behind .
Direct queue helper behind .
Direct scheduled helper behind .
Direct email helper behind .
Direct tail helper behind .
Skip Cloudflare-auth, paid, remote, or local engine tests explicitly.
Default Docker/Podman-backed container manager.
Create an isolated container manager for tests.
Check whether Docker or Podman can run.
Explain why a container test should skip.
Stop containers after tests finish.
Build pure binding fixtures from config.
Build an env object for offline-first unit tests.
Read one binding family support stance.
Read the full offline support stance map.
Mock one AI Search instance.
Mock an AI Search namespace.
Pure test context helper for small units.
Scope a pure context to one callback.
Mock KV for pure units.
Mock D1 for pure units.
Mock R2 for pure units.
Mock a Queue producer.
Mock Rate Limiting.
Mock Version Metadata.
Mock Worker Loaders.
Mock an mTLS fetcher.
Mock a dispatch namespace.
Mock a Workflow binding.
Mock a Pipelines binding.
Mock Images chains.
Mock Media Transformation chains.
Mock Artifacts repo APIs.
Mock a Secrets Store secret.
Create a pure env with selected mock bindings.
Advanced/internal service-binding resolution predicate.
Advanced/internal service-binding resolution.
Advanced/internal cross-worker Durable Object predicate.
Advanced/internal Durable Object binding resolution.
Advanced/internal resolver cache reset for tests.

Copy the default helper shape

Worker, event, offline, and boundary tests

Expected failure and skip behavior

Failure or skipMeaningFix
could not discover a supported config from the test file.Pass the config path or move the test under the package root.
The test imported the runtime env proxy instead of the test env.Use in tests.
is trueCloudflare auth or remote AI prerequisites are missing.Keep the test skipped in local/CI, or enable remote mode in a dedicated lane.
is trueDocker/Podman is missing or not usable in this runner.Install an engine or keep container tests in an optional integration job.

Previous

Binding testing

Every binding overview page already links a hidden testing guide. This page collects those guides in one place so you can jump straight to the right harness, caveats, and escalation path for the binding that changed.

Next

Svelte in workers

When a worker-only fetch surface or Durable Object imports , add the Svelte compiler to . That compilation belongs to Devflare’s worker bundler, not the main Vite plugin chain.