dánwòdánwò

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.

danwo.config.ts
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 it

Finding and running tests

OptionDefaultWhat it does
testDirthe config's folderwhere test files are found
testMatchevery *.danwo.tsglobs relative to testDir
workers1worker processes, each with its own environment
splitFilesfalsehand workers single tests, not whole files, where that is safe
retries0extra attempts for a failing test
timeout60_000one attempt's deadline, in milliseconds
baseUrlnonethe 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

OptionDefaultWhat it does
environmentnonestarts the app, emulators and proxy, once per worker
isolation"test"reset to the seeds before every test, once per "file", or "none"
sessionsnonesign-ins set up once per worker and reused (Saved sessions)
secretsnonevalues the model never sees (Secrets)
filesnonefiles tests may upload, by name
browsernonethe browser's locale, time zone, size and more (Web)

Waiting

OptionDefaultWhat it does
readiness"page+backend" with a proxyafter 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

OptionDefaultWhat it does
modelnonean AI SDK model, or a Vercel AI Gateway id
judgemodelthe model agent.assert judges with
judgeScreenshotfalseshow the judge a screenshot too
vision"auto"when the agent may see the page as an image
budget25 turns a steplimits on turns, calls, dollars and time

Replays

OptionDefaultWhat it does
cachenone: no cache{ dir }, where the replay cache lives
relocation"similar-v1"find an element that moved, or "exact" never does
effectstruea replayed step must change what its recording changed

Records and reports

OptionDefaultWhat it does
record"always", 50 runsa 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
reportersnonee.g. github() from @danwo/github (CI)
linton, never failsintegration lint levels and failOn
impactnonerules for changed tests

The fault matrix

matrix holds the matrix's own settings:

OptionDefaultWhat it does
budget40most faulted trials a matrix runs
workersworkers, else one per core (up to 8)matrix worker processes
racesall ondouble submits, early and reordered webhooks, slow retries
outboundFaultseach provider's ownthe faults planned on each provider call
webhookFaultsthe defaultsthe faults planned on each webhook
dataFaultsthe defaultsfaults on the app's database and cache calls
rerunInvalid0reruns of a trial whose fault never fired
checkPace3× the clean run, at least 1 s; on a device 6 s, once the fault firedhow long a faulted run's checks wait

See Planning and budget for how the budget is spent.

Next

On this page

Run it on every pull request

A GitHub check and one comment per pull request, with the flight records attached.

Set up CI