Skip to content

Commit 8af3536

Browse files
authored
[workers] restructure testing docs (#21560)
* flatten * change integration-testing.mdx to unstable startworker * redirects * fixup * remove duplicated redirect * pr feedback * fix links * capitalisation * more invalid links
1 parent a7112f6 commit 8af3536

File tree

23 files changed

+216
-350
lines changed

23 files changed

+216
-350
lines changed

public/__redirects

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,12 @@
15401540
/workers/tutorials/generate-dynamic-og-images-using-workers/ /workers/tutorials/ 302
15411541
/workers/static-assets/compatibility-matrix/ /workers/static-assets/migrate-from-pages/ 301
15421542
/workers/frameworks/framework-guides/remix/ /workers/frameworks/framework-guides/react-router/ 301
1543+
/workers/testing/unit-testing/ /workers/testing/vitest-integration/write-your-first-test/ 301
1544+
/workers/testing/integration-testing/ /workers/testing/ 301
1545+
/workers/testing/vitest-integration/get-started/ /workers/testing/vitest-integration/write-your-first-test/ 301
1546+
/workers/testing/vitest-integration/get-started/migrate-from-miniflare-2/ /workers/testing/vitest-integration/migration-guides/migrate-from-miniflare-2/ 301
1547+
/workers/testing/vitest-integration/get-started/migrate-from-unstable-dev/ /workers/testing/vitest-integration/migration-guides/migrate-from-unstable-dev/ 301
1548+
/workers/testing/vitest-integration/get-started/write-your-first-test/ /workers/testing/vitest-integration/write-your-first-test/ 301
15431549

15441550
# workers ai
15451551
/workers-ai/models/llm/ /workers-ai/models/#text-generation 301

src/content/docs/agents/getting-started/testing-your-agent.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ $ npx vitest
120120
Test Files 1 passed (1)
121121
```
122122

123-
Review the [documentation on testing](/workers/testing/vitest-integration/get-started/write-your-first-test/) for additional examples and test configuration.
123+
Review the [documentation on testing](/workers/testing/vitest-integration/write-your-first-test/) for additional examples and test configuration.
124124

125125
## Running Agents locally
126126

src/content/docs/workers/observability/source-maps.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ When `upload_source_maps` is set to `true`, Wrangler will automatically generate
2828

2929
:::note
3030

31-
Miniflare can also [output source maps](https://miniflare.dev/developing/source-maps) for use in local development or [testing](/workers/testing/integration-testing/#miniflares-api).
31+
Miniflare can also [output source maps](https://miniflare.dev/developing/source-maps) for use in local development or [testing](/workers/testing/miniflare/writing-tests).
3232

3333
:::
3434

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ import { Render, LinkButton } from "~/components";
99

1010
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 you to run tests to _inside_ the Workers runtime, and unit test individual functions within your Worker.
1111

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

1616
## Testing comparison matrix
1717

1818
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.
1919

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 | | | |
20+
| Feature | [Vitest integration](/workers/testing/vitest-integration) | [`unstable_startWorker()`](/workers/testing/unstable_startworker/) | [Miniflare's API](/workers/testing/miniflare/writing-tests/) |
21+
| ------------------------------------- | --------------------------------------------------------- | ------------------------------------------------------------------ | ------------------------------------------------------------ |
22+
| Unit testing | | | |
23+
| Integration testing | | | |
24+
| Loading Wrangler configuration files ||| |
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 | | | |
3333

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

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

Lines changed: 0 additions & 139 deletions
This file was deleted.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
---
22
title: Core
3-
order: 2
3+
4+
sidebar:
5+
order: 4
6+
group:
7+
hideIndex: true
48
---
59

610
import { DirectoryListing } from "~/components";

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
---
2-
order: 4
2+
sidebar:
3+
order: 4
4+
group:
5+
hideIndex: true
6+
37
title: "Developing"
48
---
59

src/content/docs/workers/testing/miniflare/get-started.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
order: 1
2+
sidebar:
3+
order: 2
34
title: Get Started
45
---
56

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Miniflare
33
pcx_content_type: navigation
44
sidebar:
5-
order: 15
5+
order: 1
66
head:
77
- tag: title
8-
content: miniflare
8+
content: Miniflare
99
---
1010

1111
import { DirectoryListing, LinkButton } from "~/components";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ head:
66
content: Migrations
77
description: Review migration guides for specific versions of Miniflare.
88
sidebar:
9+
order: 5
910
group:
1011
hideIndex: true
1112
---

0 commit comments

Comments
 (0)