Skip to content

Commit 1f3cdac

Browse files
committed
tidy up various overviews
1 parent 715e392 commit 1f3cdac

File tree

3 files changed

+43
-33
lines changed

3 files changed

+43
-33
lines changed

src/content/docs/workers/testing/index.mdx

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,28 @@ sidebar:
77

88
import { Render, LinkButton } from "~/components";
99

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.
1111

1212
<LinkButton href="/workers/testing/vitest-integration/get-started/write-your-first-test/">
13-
Write your first test
13+
Get started with Vitest
1414
</LinkButton>
1515

16+
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.
17+
1618
## Testing comparison matrix
1719

18-
| Feature | [Vitest integration](/workers/testing/vitest-integration) | [`unstable_startWorker()`](/workers/wrangler/api/#unstable_startworker) | [Miniflare's API](/workers/testing/miniflare) |
19-
| ------------------------------------- | --------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------- |
20-
| Unit testing ||||
21-
| Integration testing ||||
22-
| Loading [Wrangler configuration files](/workers/wrangler/configuration/) ||||
23-
| Use bindings directly in tests ||||
24-
| Isolated per-test storage ||||
25-
| Outbound request mocking ||||
26-
| Multiple Worker support ||||
27-
| Direct access to Durable Objects ||||
28-
| Run Durable Object alarms immediately ||||
29-
| List Durable Objects ||||
30-
| Testing service Workers ||||
20+
| Feature | [Vitest integration](/workers/testing/vitest-integration) | [`unstable_startWorker()`](/workers/wrangler/api/#unstable_startworker) | [Miniflare's API](/workers/testing/miniflare) |
21+
| ------------------------------------------------------------------------ | --------------------------------------------------------- | ----------------------------------------------------------------------- | --------------------------------------------- |
22+
| Unit testing ||||
23+
| Integration testing ||||
24+
| Loading [Wrangler configuration files](/workers/wrangler/configuration/) ||||
25+
| Use bindings directly in tests ||||
26+
| Isolated per-test storage ||||
27+
| Outbound request mocking ||||
28+
| Multiple Worker support ||||
29+
| Direct access to Durable Objects ||||
30+
| Run Durable Object alarms immediately ||||
31+
| List Durable Objects ||||
32+
| Testing service Workers ||||
3133

3234
<Render file="testing-pages-functions" product="workers" />

src/content/docs/workers/testing/vitest-integration/get-started/index.mdx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,32 @@ pcx_content_type: navigation
33
title: Get started
44
sidebar:
55
order: 1
6+
group:
7+
hideIndex: true
68
head: []
79
description: Install and set up the Workers Vitest integration.
8-
910
---
1011

11-
import { DirectoryListing } from "~/components"
12+
import { DirectoryListing } from "~/components";
1213

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.
1415

1516
The Workers Vitest integration:
1617

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.
2425

2526
Get started with one of the available guides:
2627

2728
<DirectoryListing />
2829

2930
:::caution
3031

31-
3232
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.
3333

34-
3534
:::

src/content/docs/workers/testing/vitest-integration/index.mdx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22
pcx_content_type: navigation
33
title: Vitest integration
44
sidebar:
5-
order: 5
6-
5+
order: 1
76
---
87

9-
import { DirectoryListing, Render } from "~/components"
8+
import { DirectoryListing, Render, LinkButton } from "~/components";
9+
10+
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.
1011

11-
Information about the Workers Vitest integration - the recommended package for writing unit and integration tests for Workers.
12+
The Workers Vitest integration:
1213

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.
20+
- Supports projects with multiple Workers.
1421

15-
<Render file="testing-pages-functions" product="workers" />
22+
<LinkButton href="/workers/testing/vitest-integration/get-started/write-your-first-test/">
23+
Write your first test
24+
</LinkButton>

0 commit comments

Comments
 (0)