Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Configuration

Configures the Vitest environment for Cloudflare Workers using the cloudflareTest Vite plugin and specialized helper functions for assets and D1 migrations.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Configuration

Configures the Vitest environment for Cloudflare Workers using the cloudflareTest Vite plugin and specialized helper functions for assets and D1 migrations.

When To Use

Use when setting up or customizing a Vitest testing suite to run against Cloudflare Workers, D1 databases, or Pages assets.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-testing-vitest-integration-configuration-workflow-guide.mdDocumentation detailing the cloudflareTest Vite plugin options for configuring Workers Vitest integration, including APIs for assets, D1 migrations, and testing environments.Questions about documentation detailing the cloudflareTest Vite plugin options for configuring Workers Vitest integration, including...
examples/workers-testing-vitest-integration-configuration-cloudflare-workers-vite.textA vitest configuration file demonstrating how to integrate the cloudflare-vitest-pool-workers plugin with a wrangler configuration path.Exact payloads, commands, or snippets shown in A vitest configuration file demonstrating how to integrate the cloudflare-vitest-pool-workers plugin with a wrangler...
examples/workers-testing-vitest-integration-configuration-cloudflare-workers-vite-2.textA configuration file demonstrating how to integrate the Cloudflare Vitest pool with the defineConfig function.Exact payloads, commands, or snippets shown in A configuration file demonstrating how to integrate the Cloudflare Vitest pool with the defineConfig function.
examples/workers-testing-vitest-integration-configuration-cloudflare-workers-vite-3.textA Vitest configuration file using the cloudflareTest plugin to define Miniflare service bindings and assets path.Exact payloads, commands, or snippets shown in A Vitest configuration file using the cloudflareTest plugin to define Miniflare service bindings and assets path.
examples/workers-testing-vitest-integration-configuration-cloudflare-workers-vite-4.textA Vitest configuration file demonstrating how to integrate Cloudflare Workers testing with Miniflare and D1 migration bindings.Exact payloads, commands, or snippets shown in A Vitest configuration file demonstrating how to integrate Cloudflare Workers testing with Miniflare and D1 migration...
examples/workers-testing-vitest-integration-configuration-cloudflare-workers-vite-5.textA collection of configuration files including env.d.ts, global-setup.ts, and vitest.config.ts for integrating Vitest with Cloudflare Workers.Exact payloads, commands, or snippets shown in A collection of configuration files including env.d.ts, global-setup.ts, and vitest.config.ts for integrating Vitest...
examples/workers-testing-vitest-integration-configuration-cloudflare-workers-vite-6.textA TypeScript type definition for SourcelessWorkerOptions that omits script and module properties for Vitest integration.Exact payloads, commands, or snippets shown in A TypeScript type definition for SourcelessWorkerOptions that omits script and module properties for Vitest integration.

What This Skill Covers

  • The Workers Vitest integration provides additional configuration on top of Vitest's usual options using the cloudflareTest() Vite plugin.
  • Main sections: APIs, cloudflareTest(options), buildPagesASSETSBinding(assetsPath), readD1Migrations(migrationsPath), CloudflareTestOptions.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/testing/vitest-integration/configuration