Running
Configuration
A tour of danwo.config.ts, grouped by what each option is for.
danwo.config.ts default-exports one object. Every key is optional; defineConfig only types it.
import { defineConfig, stripeEnvironment } from "@danwo/sdk"
export default defineConfig({
testDir: "tests",
workers: 2,
retries: 1,
model: "anthropic/claude-sonnet-5",
readiness: { mode: "page+backend", settle: true },
video: "retain-on-failure",
environment: () => stripeEnvironment(),
})This page groups the options. Reference: Config lists each one with its type.
The config loads like a test file: Node removes its types and compiles nothing, so an enum or a
namespace won't load. TypeScript in tests lists what works, imports
included.
Types aren't checked either, so a misspelt key would do nothing. danwo warns about each key it doesn't know, and suggests the one you likely meant:
danwo: warning: unknown config key `retires` (did you mean `retries`?); danwo ignores itFinding and running tests
| Option | Default | What it does |
|---|---|---|
testDir | the config's folder | where test files are found |
testMatch | every *.danwo.ts | globs relative to testDir |
workers | 1 | worker processes, each with its own environment |
splitFiles | false | hand workers single tests, not whole files, where that is safe |
retries | 0 | extra attempts for a failing test |
timeout | 60_000 | one attempt's deadline, in milliseconds |
baseUrl | none | the app's URL when no environment gives one |
Split slow files across workers
A worker runs one test file at a time, so one long file can keep one worker busy while the others
sit idle. splitFiles: true (or danwo test --split-files) hands out single tests instead.
danwo only splits a file whose tests share nothing: no beforeAll or afterAll, and every test on
isolation: "test". Other files still run whole. Each test loads its file again, so tests can't
pass values to each other through variables at the top of the file.
What tests run against
| Option | Default | What it does |
|---|---|---|
environment | none | starts the app, emulators and proxy, once per worker |
isolation | "test" | reset to the seeds before every test, once per "file", or "none" |
sessions | none | sign-ins set up once per worker and reused (Saved sessions) |
secrets | none | values the model never sees (Secrets) |
files | none | files tests may upload, by name |
browser | none | the browser's locale, time zone, size and more (Web) |
Waiting
| Option | Default | What it does |
|---|---|---|
readiness | "page+backend" with a proxy | after each action, wait for the page and the app's calls |
appErrors | { console: false } | console: true also fails a step on console errors |
The agent
| Option | Default | What it does |
|---|---|---|
model | none | an AI SDK model, or a Vercel AI Gateway id |
judge | model | the model agent.assert judges with |
judgeScreenshot | false | show the judge a screenshot too |
vision | "auto" | when the agent may see the page as an image |
budget | 25 turns a step | limits on turns, calls, dollars and time |
Replays
| Option | Default | What it does |
|---|---|---|
cache | none: no cache | { dir }, where the replay cache lives |
relocation | "similar-v1" | find an element that moved, or "exact" never does |
effects | true | a replayed step must change what its recording changed |
Records and reports
| Option | Default | What it does |
|---|---|---|
record | "always", 50 runs | a flight record mode, or { mode, keepRuns } to keep more runs |
video | "on" | keep video with each record, "retain-on-failure", or "off"; { mode, cursor } too |
reporters | none | e.g. github() from @danwo/github (CI) |
lint | on, never fails | integration lint levels and failOn |
impact | none | rules for changed tests |
The fault matrix
matrix holds the matrix's own settings:
| Option | Default | What it does |
|---|---|---|
budget | 40 | most faulted trials a matrix runs |
workers | workers, else one per core (up to 8) | matrix worker processes |
races | all on | double submits, early and reordered webhooks, slow retries |
outboundFaults | each provider's own | the faults planned on each provider call |
webhookFaults | the defaults | the faults planned on each webhook |
dataFaults | the defaults | faults on the app's database and cache calls |
rerunInvalid | 0 | reruns of a trial whose fault never fired |
checkPace | 3× the clean run, at least 1 s; on a device 6 s, once the fault fired | how long a faulted run's checks wait |
See Planning and budget for how the budget is spent.