You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/workers/testing/index.mdx
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,26 +7,28 @@ sidebar:
7
7
8
8
import { Render, LinkButton } from"~/components";
9
9
10
-
The Workers platform has a variety of ways to test your applications, depending on your requirements. We recommend using the [Vitest integration](/workers/testing/vitest-integration), which allows for unit testing individual functions within your Worker. However, if you don't use Vitest, both [Miniflare's API](/workers/testing/miniflare/writing-tests) and the [`unstable_startWorker()`](/workers/wrangler/api/#unstable_startworker) API provide options for testing your Worker in any testing framework.
10
+
The Workers platform has a variety of ways to test your applications, depending on your requirements. We recommend using the [Vitest integration](/workers/testing/vitest-integration), which allows for unit testing individual functions within your Worker.
However, if you don't use Vitest, both [Miniflare's API](/workers/testing/miniflare/writing-tests) and the [`unstable_startWorker()`](/workers/wrangler/api/#unstable_startworker) API provide options for testing your Worker in any testing framework.
Copy file name to clipboardExpand all lines: src/content/docs/workers/testing/vitest-integration/get-started/index.mdx
+11-12Lines changed: 11 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,33 +3,32 @@ pcx_content_type: navigation
3
3
title: Get started
4
4
sidebar:
5
5
order: 1
6
+
group:
7
+
hideIndex: true
6
8
head: []
7
9
description: Install and set up the Workers Vitest integration.
8
-
9
10
---
10
11
11
-
import { DirectoryListing } from"~/components"
12
+
import { DirectoryListing } from"~/components";
12
13
13
-
For most users, Cloudflare recommends using the Workers Vitest integration for testing Workers and [Pages Functions](/pages/functions/) projects. [Vitest](https://vitest.dev/) is a popular JavaScript testing framework featuring a very fast watch mode, Jest compatibility, and out-of-the-box support for TypeScript. In this integration, Cloudflare provides a custom pool that allows your Vitest tests to run *inside* the Workers runtime.
14
+
For most users, Cloudflare recommends using the Workers Vitest integration for testing Workers and [Pages Functions](/pages/functions/) projects. [Vitest](https://vitest.dev/) is a popular JavaScript testing framework featuring a very fast watch mode, Jest compatibility, and out-of-the-box support for TypeScript. In this integration, Cloudflare provides a custom pool that allows your Vitest tests to run _inside_ the Workers runtime.
14
15
15
16
The Workers Vitest integration:
16
17
17
-
* Supports both **unit tests** and **integration tests**.
18
-
* Provides direct access to Workers runtime APIs and bindings.
19
-
* Implements isolated per-test storage.
20
-
* Runs tests fully-locally using [Miniflare](https://miniflare.dev/).
21
-
* Leverages Vitest's hot-module reloading for near instant reruns.
22
-
* Provides a declarative interface for mocking outbound requests.
23
-
* Supports projects with multiple Workers.
18
+
- Supports both **unit tests** and **integration tests**.
19
+
- Provides direct access to Workers runtime APIs and bindings.
20
+
- Implements isolated per-test storage.
21
+
- Runs tests fully-locally using [Miniflare](https://miniflare.dev/).
22
+
- Leverages Vitest's hot-module reloading for near instant reruns.
23
+
- Provides a declarative interface for mocking outbound requests.
24
+
- Supports projects with multiple Workers.
24
25
25
26
Get started with one of the available guides:
26
27
27
28
<DirectoryListing />
28
29
29
30
:::caution
30
31
31
-
32
32
The Workers Vitest integration does not support testing Workers using the service worker format. [Migrate to the ES modules format](/workers/reference/migrate-to-module-workers/) to use the Workers Vitest integration.
For most users, Cloudflare recommends using the Workers Vitest integration for testing Workers and [Pages Functions](/pages/functions/) projects. [Vitest](https://vitest.dev/) is a popular JavaScript testing framework featuring a very fast watch mode, Jest compatibility, and out-of-the-box support for TypeScript. In this integration, Cloudflare provides a custom pool that allows your Vitest tests to run _inside_ the Workers runtime.
10
11
11
-
Information about the Workers Vitest integration - the recommended package for writing unit and integration tests for Workers.
12
+
The Workers Vitest integration:
12
13
13
-
<DirectoryListing />
14
+
- Supports both **unit tests** and **integration tests**.
15
+
- Provides direct access to Workers runtime APIs and bindings.
16
+
- Implements isolated per-test storage.
17
+
- Runs tests fully-locally using [Miniflare](https://miniflare.dev/).
18
+
- Leverages Vitest's hot-module reloading for near instant reruns.
19
+
- Provides a declarative interface for mocking outbound requests.
0 commit comments