vitest-cloudflare-config

Configure and run Cloudflare Workers tests with D1 and KV bindings.

Updated Feb 8, 2026
One-click install
npx skills add https://github.com/eykd/vance-ts --skill vitest-cloudflare-config
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vitest-cloudflare-config
Source: https://github.com/eykd/vance-ts/tree/main/.claude/skills/vitest-cloudflare-config
Command: npx skills add https://github.com/eykd/vance-ts --skill vitest-cloudflare-config

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires vitest, @cloudflare/vitest-pool-workers, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses the challenge of setting up and configuring @cloudflare/vitest-pool-workers for effective testing of Cloudflare Workers, ensuring that tests run in an environment that accurately mirrors the runtime conditions of Cloudflare Workers.

Core Features & Use Cases

  • Cloudflare Workers Testing: Provides a configuration to run @cloudflare/vitest-pool-workers for testing Workers, including D1, KV, and other bindings.
  • Runtime Constraints: Includes critical information about API limitations and required web standards for Workers testing.
  • Installation and Configuration: Offers detailed instructions on how to install and configure the necessary tools and settings for testing.
  • D1 and KV Bindings: Specifies how to use D1 and KV bindings with migrations and namespaces in tests.
  • Test Patterns: Describes how to structure tests for different scenarios, such as unit, integration, and acceptance testing.

Quick Start

Run 'npm install -D vitest @cloudflare/vitest-pool-workers' to install dependencies, then configure your vitest.config.ts file according to the provided example.

Frequently Asked Questions about vitest-cloudflare-config

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Vitest for Cloudflare Workers testing?

Yes, you can test D1 databases and KV namespaces using `@cloudflare/vitest-pool-workers`. The configuration supports specifying D1 and KV bindings directly, including running migrations and defining namespaces for your test suites.

What do I need to install to run Vitest pool workers?

You need to run `npm install -D vitest @cloudflare/vitest-pool-workers` to install the required dependencies. This provides the testing framework and the specific pool integration needed to mirror the Cloudflare Workers runtime.

Does Cloudflare Workers testing with Vitest have runtime constraints?

Yes, Cloudflare Workers testing with Vitest has runtime constraints. The configuration includes critical information about API limitations and required web standards that must be followed to ensure tests accurately reflect the actual Workers environment.

What test patterns should I use for Cloudflare Workers?

You should structure your Cloudflare Workers tests using unit, integration, and acceptance testing patterns. The configuration provides specific guidance on organizing these different test scenarios to validate Workers code and bindings effectively.