GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Directory
  • API
  • SDKs
  • Changelog
  • Log inDashboard
  • Workers
  • Testing
  • View as Markdown
  • Agent setup
  • NextWrite your first test
  • Edit page
  • Report issue
  • CLI

This view

  • Original page
  • New address

GeezerVison is showing developers.cloudflare.com — Vitest integration

Vitest integration

For most users, Cloudflare recommends using the Workers Vitest integration for unit testing Workers and Pages Functions projects. Vitest ↗︎ is a popular JavaScript testing framework featuring a fast watch mode, Jest compatibility, and default TypeScript support. Cloudflare provides the @cloudflare/vitest-plugin Vite plugin, which runs your Vitest tests inside the Workers runtime.

The Workers Vitest integration:

  • Supports both unit tests and integration tests.
  • Provides direct access to Workers runtime APIs and bindings.
  • Implements isolated per-test-file storage.
  • Runs tests fully-locally using Miniflare ↗︎.
  • Leverages Vitest's hot-module reloading for near instant reruns.
  • Supports projects with multiple Workers.

Write your first test

If you use @cloudflare/vitest-pool-workers, refer to Migrate to Vitest plugin.

Was this helpful?

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.