Files
Nathan Rajlich e1e64e3de3 docs: apply Vercel technical writing standards (#3704)
* docs: apply Vercel technical writing standards

Audit the complete documentation corpus, package READMEs, skills, and
source TSDoc/comments against the vercel-technical-writing skill and
style-rules.md. Normalize sentence-case headings without changing
published anchors, remove prose em dashes and filler wording, improve
active voice and self-contained phrasing, standardize product/brand
capitalization, American English, list punctuation, units, and code
fence languages, and preserve exact runtime strings/table placeholders.

All executable code is unchanged. Modified skills have their metadata
versions bumped.

* docs: extend writing audit to repository Markdown

Apply the same technical-writing rules to design documents, compiler
specifications, workbench guides, package changelogs, and the remaining
tracked Markdown outside the deployed docs corpus. Preserve historical
meaning, commands, output literals, table placeholders, and heading
anchors.

* docs: exclude generated package changelogs from audit
2026-08-21 14:24:31 -07:00
..

@workflow/vitest-workbench

This workbench demonstrates how to test workflows with Vitest using the @workflow/vitest plugin.

How it works

  1. Vitest plugin: The workflow() plugin from @workflow/vitest handles SWC transforms, bundle building, and in-process handler registration automatically.
  2. No server required: Workflows execute entirely in-process using a Local World instance, so they don't need an HTTP server.
  3. Tests: Use start(workflow, args) and await run.returnValue, plus helpers like waitForSleep() and waitForHook().

Usage

pnpm test

Project structure

workbench/vitest/
├── workflows/
│   ├── simple.ts          # Basic workflow with arithmetic steps
│   ├── sleeping.ts        # Workflows with sleep() calls
│   ├── hooks.ts           # Workflow with createHook() for external data
│   └── webhook.ts         # Workflow with createWebhook() for HTTP payloads
├── test/
│   └── workflow.test.ts   # Integration tests for all workflow types
├── vitest.config.ts       # Vitest config with workflow() plugin
├── MOCKING.md             # Analysis of mocking limitations
└── package.json

Test coverage

  • Basic workflow: Start and await return value
  • Sleep workflow: waitForSleep() → wakeUp() to skip sleep
  • Multi-sleep workflow: Targeted wakeUp() with correlation IDs
  • Hook workflow: waitForHook() → resumeHook() with approval/rejection
  • Webhook workflow: waitForHook() → resumeWebhook() with Request payload