Project
Every export
Every name @danwo/sdk exports, with its kind and what it is: one list to search.
Each name a test file or config can import, with its kind and what it is.
DanwoFixtures
interface
Fixtures every danwo test gets: the browser session's agent, screen and app, plus expect, secret and mail bound to it.
StripeFixtures
interface
Fixtures a stripeEnvironment() worker environment contributes; type them with test.extend<StripeFixtures>().
S3Fixtures
interface
Fixtures an s3Environment() or s3Service() contributes.
ResendFixtures
interface
Fixtures a resendEnvironment() or resendService() contributes.
AwsFixtures
interface
Fixtures an awsEnvironment() or awsService() (MiniStack) contributes.
Auth0Fixtures
interface
Fixtures an auth0Environment() or auth0Service() contributes.
GoogleFixtures
interface
Fixtures a googleEnvironment() or googleService() contributes.
MicrosoftFixtures
interface
Fixtures a microsoftEnvironment() or microsoftService() contributes.
SlackFixtures
interface
Fixtures a slackEnvironment() or slackService() contributes.
GithubFixtures
interface
Fixtures a githubEnvironment() or githubService() contributes.
FlutterwaveFixtures
interface
Fixtures a flutterwaveEnvironment() or flutterwaveService() contributes.
BachsFixtures
interface
Fixtures a bachsEnvironment() or bachsService() contributes.
NylasFixtures
interface
Fixtures a nylasEnvironment() or nylasService() contributes.
NangoFixtures
interface
Fixtures a nangoEnvironment() or nangoService() contributes.
UnipileFixtures
interface
Fixtures a unipileEnvironment() or unipileService() contributes.
ComposioFixtures
interface
Fixtures a composioEnvironment() or composioService() contributes.
PusherFixtures
interface
Fixtures a pusherEnvironment() or pusherService() contributes.
NovuFixtures
interface
Fixtures a novuEnvironment() or novuService() contributes.
TiptapFixtures
interface
Fixtures a tiptapEnvironment() or tiptapService() contributes.
ClerkFixtures
interface
Fixtures a clerkEnvironment() or clerkService() contributes.
LlmFixtures
interface
Fixtures an llmEnvironment() or llmService() contributes.
TwilioFixtures
interface
Fixtures a twilioEnvironment() or twilioService() contributes.
PaystackFixtures
interface
Fixtures a paystackEnvironment() or paystackService() contributes.
test
value
test typed with danwo's fixtures; the same runtime function as the runner's.
describe
value
Groups tests under a title (test.describe), with .skip and .only.
beforeEach
value
Runs before each test of the enclosing describe block, or of the file (test.beforeEach).
afterEach
value
Runs after each test of the enclosing describe block, or of the file (test.afterEach).
beforeAll
value
Runs once before the tests of the enclosing describe block, or of the file (test.beforeAll).
afterAll
value
Runs once after the tests of the enclosing describe block, or of the file (test.afterAll).
AppCommand
interface
How danwo starts the app.
appEnvironment
function
appEnvironment( options: AppEnvironmentOptions = {}, ): Promise<WorkerEnvironment>A worker environment for any app: the services behind one proxy, the app started through it (so its calls to Stripe, Resend and the rest reach the emulators with no code change), and the lifecycle danwo matrix needs. The app keeps running between tests and matrix trials; resets put the services back to their seeds.
AppEnvironmentOptions
interface
Options of appEnvironment().
ModelPrice
interface
Dollars per million tokens.
priced
function
priced(model: Exclude<LanguageModel, string>, price: ModelPrice): LanguageModelV4model with each call's cost worked out from price, e.g. priced(anthropic("claude-sonnet-5"), { input: 3, output: 15 }). A call whose provider already says what it cost keeps that figure.
NangoEnvironment
type
What nangoEnvironment() starts: Nango, and any backends, behind one proxy.
nangoEnvironment
function
nangoEnvironment( options: NangoOptions & Unrouted = {}, ): Promise<NangoEnvironment>A worker-scoped Nango emulator behind its own proxy, with its backends on the same proxy.
NangoOptions
interface
Options of nangoService() and nangoEnvironment().
nangoService
function
nangoService(options: NangoOptions = {}): OAuthServiceNango for startServices: integrations, connect sessions and the hosted Connect UI, connections whose tokens refresh on the emulator's clock, the proxy, actions, records and signed auth webhooks on api.nango.dev and connect.nango.dev; gives tests the nango fixture. Read it and revoke connections with nangoProject(nango). List the backends before it.
NylasEnvironment
type
What nylasEnvironment() starts: the Nylas emulator behind its own proxy.
nylasEnvironment
function
nylasEnvironment(options: NylasOptions & Unrouted = {}): Promise<NylasEnvironment>A worker-scoped Nylas emulator behind its own proxy; combine services with startServices.
NylasOptions
interface
Options of nylasService() and nylasEnvironment().
nylasService
function
nylasService(options: NylasOptions = {}): OAuthServiceNylas for startServices: hosted auth and grants, mail, calendars and events, contacts, the scheduler and signed webhooks on api.us.nylas.com and api.eu.nylas.com; gives tests the nylas fixture. Read and act on it with nylasApplication(nylas).
ResendEnvironment
type
What resendEnvironment() starts: the Resend emulator behind its own proxy.
resendEnvironment
function
resendEnvironment( options: ResendOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<ResendEnvironment>A worker-scoped Resend emulator behind its own proxy; combine services with startServices.
ResendOptions
interface
Options of resendService() and resendEnvironment().
resendService
function
resendService(options: ResendOptions = {}): OAuthServiceResend for startServices: sending email, domains, API keys and signed webhooks on api.resend.com; gives tests the resend fixture and resendMail(resend) as a mail source.
UnipileEnvironment
type
What unipileEnvironment() starts: the Unipile emulator behind its own proxy.
unipileEnvironment
function
unipileEnvironment( options: UnipileOptions & Unrouted = {}, ): Promise<UnipileEnvironment>A worker-scoped Unipile emulator behind its own proxy; combine services with startServices.
UnipileOptions
interface
Options of unipileService() and unipileEnvironment().
unipileService
function
unipileService(options: UnipileOptions = {}): OAuthServiceUnipile for startServices: hosted auth links, connected LinkedIn, WhatsApp and mail accounts, chats, messages, mail and webhooks on every *.unipile.com DSN; gives tests the unipile fixture. Act as the other side with unipileWorkspace(unipile).
StartedApp
interface
An app startApp started.
startApp
function
startApp( app: AppCommand, env: NodeJS.ProcessEnv = process.env, ): Promise<StartedApp>Starts the app with app.command and env (the proxy's, from proxy.env()), and resolves once it is ready (app.url answers, by default). Refuses to start when something already answers there: danwo would test that server, whose calls to providers do not go through the proxy. The command reads no input: its stdin is empty, so nothing waits on a prompt.
StackApp
interface
One app of the stack.
stackEnvironment
function
stackEnvironment( options: StackEnvironmentOptions, ): Promise<WorkerEnvironment>A worker environment for a stack of apps: the services behind one proxy, every app started through it in dependsOn order, and the lifecycle danwo matrix needs. Apps keep running between tests; resets put the services back to their seeds.
StackEnvironmentOptions
interface
Options of stackEnvironment().
StackUrls
type
The other apps' URLs, by name, for wiring one app's environment to another's.
UnroutedHosts
interface
What happens to calls for hosts no service answers.
INNGEST_HOST
value
The host the apps send Inngest events to; the proxy routes it to the dev server.
InngestOptions
interface
Options of inngestService().
InngestRun
interface
One function run an event triggered, as the flight record keeps it.
InngestService
interface
What inngestService() returns: the service, and the environment the apps need.
inngestService
function
inngestService(options: InngestOptions = {}): Promise<InngestService>Inngest for startServices: events the apps send to inngest.danwo.test reach the dev server through the proxy, settle waits for the runs they triggered, and state lists those runs.
Auth0Environment
type
What auth0Environment() starts: the Auth0 emulator behind its own proxy.
auth0Environment
function
auth0Environment( options: Auth0Options & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<Auth0Environment>A worker-scoped Auth0 emulator behind its own proxy; combine services with startServices.
Auth0Options
interface
Options of auth0Service() and auth0Environment().
auth0Service
function
auth0Service(options: Auth0Options = {}): OAuthServiceAuth0 for startServices: Universal Login (the browser logs in, signs up and passes MFA on the tenant's domain through the same proxy), the authentication API's grants, OIDC discovery and keys, logout and the Management API v2; gives tests the auth0 fixture. Read users, logins and verification emails with auth0Tenant(auth0).
AwsEnvironment
interface
What awsEnvironment() starts: AWS hosts sent to MiniStack through its own proxy.
awsEnvironment
function
awsEnvironment( options: AwsOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<AwsEnvironment>A worker-scoped MiniStack behind its own danwo proxy. To combine it with emulators behind one proxy (e.g. Stripe and S3 emulators, MiniStack for SQS), use awsService with startServices.
AwsFixture
interface
What tests get as the aws fixture.
AwsOptions
interface
Options of awsService() and awsEnvironment(): where MiniStack runs and what it answers.
awsService
function
awsService(options: AwsOptions = {}): Promise<Service & AwsFixture>AWS through MiniStack for startServices: AWS hosts are forwarded to a MiniStack the user runs (endpoint) or one started per worker (docker), with their original Host, so an unmodified app keeps calling sqs.us-east-1.amazonaws.com or <bucket>.s3.amazonaws.com.
DanwoConfig
interface
What danwo.config.ts default-exports; every key is optional.
defaultOutboundFaults
function
defaultOutboundFaults(call: OutboundCall): readonly OutboundFault[]danwo matrix's default fault catalogue: each call gets its provider's faults by host (Stripe, Resend, S3 and Tigris, Auth0, Google, Microsoft, Slack, GitHub, Twilio, Flutterwave, Paystack, Bachs, Clerk, Composio, Nylas, Nango, Unipile, Pusher, Novu, Tiptap and the model APIs, with error bodies their SDKs parse), and any other routed host (an outside endpoint such as MiniStack) gets plain HTTP failures.
defineConfig
function
defineConfig(config: DanwoConfig): DanwoConfigTypes a project's config; returns it unchanged.
EnvironmentContext
interface
What a config's environment() is called with, once per worker.
expect
value
The expect of danwo tests.
FlutterwaveEnvironment
type
What flutterwaveEnvironment() starts: the Flutterwave emulator behind its own proxy.
flutterwaveEnvironment
function
flutterwaveEnvironment( options: FlutterwaveOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<FlutterwaveEnvironment>A worker-scoped Flutterwave emulator behind its own proxy; combine services with startServices.
FlutterwaveOptions
interface
Options of flutterwaveService() and flutterwaveEnvironment().
flutterwaveService
function
flutterwaveService(options: FlutterwaveOptions = {}): OAuthServiceFlutterwave for startServices: Standard payment links with their hosted checkout (the browser pays on checkout.flutterwave.com through the same proxy), verification, refunds, plans and subscriptions, transfers and virtual accounts, with webhooks and transfer settlements on a manual clock that settle plays to the end; gives tests the flutterwave fixture. Read the books with flutterwaveLedger(flutterwave).
GithubEnvironment
type
What githubEnvironment() starts: the GitHub emulator behind its own proxy.
githubEnvironment
function
githubEnvironment( options: GithubOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<GithubEnvironment>A worker-scoped GitHub emulator behind its own proxy; combine services with startServices.
GithubOptions
interface
Options of githubService() and githubEnvironment().
githubService
function
githubService(options: GithubOptions = {}): OAuthServiceGitHub for startServices: sign-in, GitHub Apps, the REST API and signed webhooks; gives tests the github fixture.
ComposioEnvironment
type
What composioEnvironment() starts: Composio, and any backends, behind one proxy.
composioEnvironment
function
composioEnvironment( options: ComposioOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<ComposioEnvironment>A worker-scoped Composio emulator behind its own proxy, with its backends on the same proxy; combine services with startServices instead when the app talks to more.
ComposioOptions
interface
Options of composioService() and composioEnvironment().
composioService
function
composioService(options: ComposioOptions = {}): OAuthServiceComposio for startServices: toolkits and tools, tool execution, auth configs, connected accounts with hosted connect links (the browser connects through the same proxy), triggers and the project's signed webhooks; gives tests the composio fixture. Read accounts and tool runs, and fire triggers, with composioProject(composio); answer tools with composioTools(composio). List the backends before it when starting the services together.
NovuEnvironment
type
What novuEnvironment() starts: the Novu emulator behind its own proxy.
novuEnvironment
function
novuEnvironment(options: NovuOptions & Unrouted = {}): Promise<NovuEnvironment>A worker-scoped Novu emulator behind its own proxy; combine services with startServices.
NovuOptions
interface
Options of novuService() and novuEnvironment().
novuService
function
novuService(options: NovuOptions = {}): OAuthServiceNovu for startServices: the server API the app's backend triggers workflows and manages subscribers with, code-first workflows run through the app's bridge (seed.bridgeUrl), and the Inbox's API and socket the browser uses; gives tests the novu fixture. settle waits for the workflow runs. Read runs and messages with novuProject(novu).
PusherEnvironment
type
What pusherEnvironment() starts: the Pusher emulator behind its own proxy.
pusherEnvironment
function
pusherEnvironment( options: PusherOptions & Unrouted = {}, ): Promise<PusherEnvironment>A worker-scoped Pusher emulator behind its own proxy; combine services with startServices.
PusherOptions
interface
Options of pusherService() and pusherEnvironment().
pusherService
function
pusherService(options: PusherOptions = {}): OAuthServicePusher for startServices: the Channels API the app's server triggers events on, the socket pusher-js connects to from the browser, signed webhooks and Beams; gives tests the pusher fixture. Read what was published and who it reached with pusherChannels(pusher).
TiptapEnvironment
type
What tiptapEnvironment() starts: the Tiptap emulator behind its own proxy.
tiptapEnvironment
function
tiptapEnvironment( options: TiptapOptions & Unrouted = {}, ): Promise<TiptapEnvironment>A worker-scoped Tiptap emulator behind its own proxy; combine services with startServices.
TiptapOptions
interface
Options of tiptapService() and tiptapEnvironment().
tiptapService
function
tiptapService(options: TiptapOptions = {}): OAuthServiceTiptap Cloud collaboration for startServices: the socket editors sync documents over and the documents REST API on <appId>.collab.tiptap.cloud; gives tests the tiptap fixture. Read a document with tiptapCollab(tiptap).text(name).
GoogleEnvironment
type
What googleEnvironment() starts: the Google emulator behind its own proxy.
googleEnvironment
function
googleEnvironment( options: GoogleOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<GoogleEnvironment>A worker-scoped Google emulator behind its own proxy; combine services with startServices.
GoogleOptions
interface
Options of googleService() and googleEnvironment().
googleService
function
googleService(options: GoogleOptions = {}): OAuthServiceGoogle for startServices: sign-in, Gmail, Calendar and Drive on Google's real hosts; gives tests the google fixture.
LlmEnvironment
type
What llmEnvironment() starts: the model API emulator behind its own proxy.
llmEnvironment
function
llmEnvironment( options: LlmOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<LlmEnvironment>A worker-scoped model API emulator behind its own proxy; combine services with startServices.
LlmOptions
interface
Options of llmService() and llmEnvironment().
llmService
function
llmService(options: LlmOptions = {}): OAuthServiceModel APIs for startServices: api.openai.com, api.anthropic.com, ai-gateway.vercel.sh, generativelanguage.googleapis.com, api.perplexity.ai and bedrock-runtime.<region>.amazonaws.com answered from the seed's scripts, streamed when asked; gives tests the llm fixture. Read the calls back with llmCalls(llm) and add scripts with llmScripts(llm).
MicrosoftEnvironment
type
What microsoftEnvironment() starts: the Microsoft emulator behind its own proxy.
microsoftEnvironment
function
microsoftEnvironment( options: MicrosoftOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<MicrosoftEnvironment>A worker-scoped Microsoft emulator behind its own proxy; combine services with startServices.
MicrosoftOptions
interface
Options of microsoftService() and microsoftEnvironment().
microsoftService
function
microsoftService(options: MicrosoftOptions = {}): OAuthServiceMicrosoft for startServices: sign-in and Graph mail, calendar, OneDrive and subscriptions; gives tests the microsoft fixture.
MINISTACK_IMAGE
value
The MiniStack image docker: true runs; MiniStack is MIT-licensed (ministack.org).
PaystackEnvironment
type
What paystackEnvironment() starts: the Paystack emulator behind its own proxy.
paystackEnvironment
function
paystackEnvironment( options: PaystackOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<PaystackEnvironment>A worker-scoped Paystack emulator behind its own proxy; combine services with startServices.
PaystackOptions
interface
Options of paystackService() and paystackEnvironment().
paystackService
function
paystackService(options: PaystackOptions = {}): OAuthServicePaystack for startServices: the API and the hosted payment page the customer's browser opens, with events, transfers, refunds and subscription renewals on a manual clock that settle plays to the end; gives tests the paystack fixture. Read what was paid with paystackLedger(paystack).
S3Environment
interface
What s3Environment() starts: the S3 emulator behind its own proxy.
s3Environment
function
s3Environment( options: S3Options & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<S3Environment>A worker-scoped S3 emulator behind its own danwo proxy. To combine it with other services behind one proxy, use s3Service with startServices.
S3Options
interface
Options of s3Service() and s3Environment(): buckets to seed and endpoints to answer.
s3Service
function
s3Service(options: S3Options = {}): S3ServiceAn S3 emulator for startServices, for apps on AWS S3 or Tigris; gives tests the s3 fixture.
Seed
type
Seed data applied on start and after every reset. A function runs each time, so it can use values only known once the app is up, such as its push or notification URL.
Service
interface
One faked third party behind the worker's proxy: the hosts it answers (an emulator in-process or an outside endpoint such as MiniStack), the fixtures it gives tests, and how it settles and resets. startServices puts any mix of them behind one proxy.
Services
interface
Services started together; its fields slot straight into a WorkerEnvironment.
SlackEnvironment
type
What slackEnvironment() starts: the Slack emulator behind its own proxy.
slackEnvironment
function
slackEnvironment( options: SlackOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<SlackEnvironment>A worker-scoped Slack emulator behind its own proxy; combine services with startServices.
SlackOptions
interface
Options of slackService() and slackEnvironment().
slackService
function
slackService(options: SlackOptions = {}): OAuthServiceSlack for startServices: OAuth installs, the Web API, incoming webhooks and signed events; gives tests the slack fixture.
startServices
function
startServices( services: readonly Service[], options: UnroutedHosts = {}, ): Promise<Services>Starts one proxy in front of services, e.g. a Stripe emulator, an S3 emulator and MiniStack for the rest of AWS. Other hosts pass through unless unmatched is block.
StripeEnvironment
interface
What stripeEnvironment() starts: the Stripe emulator behind its own proxy, on a manual clock.
stripeEnvironment
function
stripeEnvironment( options: StripeOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<StripeEnvironment>A worker-scoped Stripe emulator behind its own danwo proxy: api.stripe.com and checkout.stripe.com route to it, other hosts pass through. To combine it with other services behind one proxy, use stripeService with startServices.
StripeOptions
interface
Options of stripeService() and stripeEnvironment().
stripeService
function
stripeService(options: StripeOptions = {}): StripeServiceA Stripe emulator for startServices: answers api.stripe.com, checkout.stripe.com and js.stripe.com, delivers webhooks on a manual clock, and gives tests the stripe fixture.
TestAPI
interface
test: declares a test (test(title, body)), with only, skip, describe, the hooks, use, session and extend on it.
SessionDefinition
type
A saved session: setup runs once per worker, its browser state (cookies, localStorage, IndexedDB) is kept, and every test that uses the session starts from that state. When the environment resets, the state is dropped and setup runs again on next use. check, if given, runs at the start of each test that reuses the state and throws when the state no longer works (say, a page that should show the signed-in user); the session is then set up afresh.
SessionFixtures
interface
What a session's setup and check receive: a fresh browser session's handles.
SessionSetup
type
Signs in (or reaches whatever state the session stands for) in a fresh browser.
TestCase
interface
The value test(...) returns, to attach what must hold whichever way the body went.
TestFixtures
interface
What every test body, hook and invariant receives before environment and extended fixtures.
TestOptions
interface
Options of one test: test(title, options, body).
TwilioEnvironment
type
What twilioEnvironment() starts: the Twilio emulator behind its own proxy.
twilioEnvironment
function
twilioEnvironment( options: TwilioOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<TwilioEnvironment>A worker-scoped Twilio emulator behind its own proxy; combine services with startServices.
TwilioOptions
interface
Options of twilioService() and twilioEnvironment().
twilioService
function
twilioService(options: TwilioOptions = {}): OAuthServiceTwilio for startServices: messages with status callbacks, texts to the app's numbers and Verify, with message statuses moving on a manual clock that settle plays to the end; gives tests the twilio fixture. Read texts and codes with twilioInbox(twilio), or with twilioSms(twilio) as a session's message source.
BachsEnvironment
type
What bachsEnvironment() starts: the Bachs emulator behind its own proxy.
bachsEnvironment
function
bachsEnvironment( options: BachsOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<BachsEnvironment>A worker-scoped Bachs emulator behind its own proxy; combine services with startServices.
BachsOptions
interface
Options of bachsService() and bachsEnvironment().
bachsService
function
bachsService(options: BachsOptions = {}): OAuthServiceBachs for startServices: the API on its live and sandbox hosts, the hosted checkout, overlay script, recovery page and customer portal, with payments settling, subscriptions renewing and payouts completing on a manual clock that settle plays to the end; gives tests the bachs fixture. Read what happened with bachsLedger(bachs).
unique
function
unique(value: string): UniqueMarks value as fresh on every run: a recorded step replays with the value of this run.
UseOptions
interface
Options test.use applies to every test of its describe block, or of its file at the top level.
UserOptions
interface
How users.open starts a person's browser.
Users
interface
Other people's browsers in this test, beside the test's own: const bob = await users.open("bob", { session: "bob-signed-in" }) gives Bob's app, screen, expect and agent, working on a browser context of their own behind the same proxy. Their steps, calls and video are recorded under their name, and the browser closes when the test ends. Web only.
UserSession
interface
Another person's browser in a test, from WebSession.openUser: the same handles a test has for its own browser, working on that person's context.
WorkerEnvironment
interface
What a worker runs its tests against, set up once per worker by the config's environment hook: the app's URL, the proxy its browser and app go through, emulators, and any values tests receive as fixtures. Worker-scoped: it lives as long as the worker and is reset between matrix runs.
ActOptions
interface
Options of agent.act.
ActResult
interface
What agent.act resolves with.
Agent
interface
The agent fixture: steps and claims in plain language, replayed from recordings when it can.
App
interface
The app as a test sees it.
AssertOptions
interface
Options of agent.assert.
BrowserConfig
type
The config's browser key.
ContextOptions
type
The options of every browser context a run opens.
ExtractOptions
interface
Options of agent.extract.
LocatorAssertions
interface
What expect(locator) offers.
MailMessage
interface
One email as a test or the agent reads it.
MailSource
interface
Somewhere mail lands: an emulator's outbox or mailbox.
PageAssertions
interface
What expect(screen) offers: checks of the whole page.
PollOption
type
How long to keep looking, and how often; true takes the session's assertion timeout.
ReadinessMode
type
What is waited for after an action: the page, the page and the backend, or nothing.
Screen
interface
Finds elements the way a user names them.
SessionMail
interface
The mail the app sent, as a test reads it.
SessionTime
interface
A session's time, as tests (time fixture) and the agent move it.
Span
type
How far to travel: milliseconds, or days, hours, minutes and seconds added up.
VisionChoice
type
A call's own choice: true is always for this step, false off, "auto" the default.
VisionMode
type
When the agent may look at the page as an image. off: never. auto (default): it can ask to, and is told when the page has things the text view misses (a canvas, unnamed buttons, frames whose content is not listed). always: it is shown a screenshot with every view.
VisionSetting
type
A session's vision setting: a mode, or a mode with a model of its own for images.
VisualOptions
interface
Options of toHaveScreenshot: how strict, and which elements to paint over.
WaitForOptions
interface
Options of agent.waitFor.
gmailMail
function
gmailMail(emulator: Pick<Emulator, "store" | "outbox">): MailSourceMail delivered to a Gmail mailbox of the Google emulator.
outlookMail
function
outlookMail(emulator: Pick<Emulator, "store" | "outbox">): MailSourceMail delivered to an Outlook mailbox of the Microsoft emulator.
resendMail
function
resendMail(emulator: Pick<Emulator, "store">): MailSourceMail the Resend emulator accepted from the app.
totp
function
totp(key: string, settings: TotpSettings = {}, atMs = Date.now()): stringThe time-based code for the base32 key at atMs (default now).
twilioSms
function
twilioSms(emulator: Pick<Emulator, "store">): MailSourceTexts the Twilio emulator sent to phones, by the app or by Verify, read like mail: the address is the phone number, so read_mail, mail.code(phone) and the recording of a typed code work for SMS just as for email, and a replay reads the new code from the new phone's texts.
OwnedChild
interface
A started child and how to stop it with everything it started.
spawnOwned
function
spawnOwned( command: string, args: readonly string[], options: SpawnOptions = {}, ): OwnedChildspawn() for a child danwo owns: it leads its own process group and is stopped, with what it started, when its owner stops it, exits, is interrupted or dies.
z
value
zod, for the schemas agent.extract checks its result against.
ImpactConfig
interface
How a project maps its own source files to what its tests touch (impact in the config).
junit
function
junit(options: JunitOptions = {}): ReporterWrites a JUnit XML file when a run finishes; --reporter junit on the command line.
JunitOptions
interface
A JUnit XML reporter for CI systems other than GitHub, and the config's change-impact rules.
Auth0LoginView
interface
One login, as a test reads it.
auth0OtpAt
function
otpAt(secret: string, time: Date): stringThe one-time code an authenticator app shows for secret at time.
Auth0SeedApi
interface
An API (resource server) tokens can be issued for, by its identifier (the audience).
Auth0SeedClient
interface
An application on a tenant: a web app, SPA, native app or machine-to-machine client.
Auth0SeedConfig
interface
Tenants, their applications, APIs, roles, organizations and users, to load into an emulator.
Auth0SeedRole
interface
A role and the API permissions it grants.
Auth0SeedTenant
interface
A tenant: its domains, applications, APIs, roles, organizations, users and social logins.
Auth0SeedUser
type
A user in the tenant's database connection, with their roles and organizations by name.
Auth0Tenant
interface
What a tenant holds and has done, for tests.
auth0Tenant
function
auth0Tenant(emulator: Pick<Emulator, "store">, domain?: string): Auth0TenantWhat domain's tenant holds and has done; the first tenant when no domain is given.
Auth0UserView
type
A user as a test reads it: the Management API's view plus their role names.
CalendarEntry
interface
An event occurrence as a test reads it.
CalendarEvent
interface
A Calendar event as the API answers it.
CalendarSeedEvent
type
An event already on a primary calendar when the emulator starts.
Emulator
interface
A running emulator instance.
DriveEntry
interface
A drive item as a test reads it.
DriveFile
interface
A Drive file (or folder) as the API answers it; size is a decimal string of bytes.
DriveSeedFile
interface
A file already in a user's Drive when the emulator starts.
FlutterwaveBank
interface
What flutterwaveBank(emulator) does: money arriving at virtual accounts.
flutterwaveBank
function
flutterwaveBank(emulator: Pick<Emulator, "store" | "outbox">): FlutterwaveBankMoney arriving at a Flutterwave emulator's virtual accounts.
FlutterwaveLedger
interface
What flutterwaveLedger(emulator) reads and does: the merchant's books in the emulator.
flutterwaveLedger
function
flutterwaveLedger(emulator: Pick<Emulator, "store" | "outbox">): FlutterwaveLedgerThe books of a Flutterwave emulator.
FlutterwaveSeedConfig
type
Data to load into a Flutterwave emulator.
GithubCheckRunView
type
A check run as a test reads it.
GithubCommentView
interface
A comment as a test reads it.
GithubIssueView
interface
An issue or pull request as a test reads it.
GithubRepoView
interface
What a test can read from one repository.
GithubSeedConfig
type
People, organisations, repositories, apps and credentials to load into a GitHub emulator.
githubAppKey
function
githubAppKey(emulator: Pick<Emulator, "store">, slug: string): stringThe private key (PEM) of a seeded GitHub App, for signing its JWTs.
githubRepo
function
githubRepo(emulator: Pick<Emulator, "store">, fullName: string): GithubRepoViewReads a repository's issues, comments, check runs and files from a GitHub emulator.
githubSignIns
function
githubSignIns(emulator: Pick<Emulator, "store">): SignInsWho signed in to which OAuth App or GitHub App, for tests.
GmailMailbox
interface
What gmailMailbox(emulator, user) reads and does: a user's Gmail messages.
GmailMessage
type
One message in a Gmail mailbox, as a test reads it: ids and labels, the From, To and Subject headers, the plain and HTML bodies, when Gmail received it, and any other header by name.
GmailSeedMessage
type
A message already in a mailbox when the emulator starts. Labels are ids or label names.
gmailMailbox
function
gmailMailbox( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): GmailMailboxReads and changes email's Gmail mailbox from a test.
GoogleCalendar
interface
Reads and changes email's primary calendar from a test.
GoogleDrive
interface
Reads and changes email's Drive from a test.
GoogleSeedConfig
type
Accounts, OAuth clients and API data to load into a Google emulator.
googleCalendar
function
googleCalendar( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): GoogleCalendarA user's Google Calendar in the emulator: read events, and change them as if from elsewhere.
googleDrive
function
googleDrive( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): GoogleDriveA user's Google Drive in the emulator: read files, and change them as if from elsewhere.
googleSignIns
function
googleSignIns(emulator: Pick<Emulator, "store">): SignInsWho signed in to which client, for tests.
GraphSubscriptionEntry
interface
A change notification subscription as a test reads it.
graphSubscriptions
function
graphSubscriptions(emulator: Pick<Emulator, "store">): GraphSubscriptionEntry[]The subscriptions apps have made in a Microsoft emulator, live or expired.
InboxEmail
interface
One email the emulator accepted, as a test reads it.
IncomingMail
type
A message to drop into a mailbox, as if it arrived from outside. labelIds files it under those labels; INBOX and UNREAD by default.
installGithubApp
function
installGithubApp( emulator: Pick<Emulator, "store" | "outbox">, installation: GithubSeedInstallation, ): numberInstalls a seeded app on an account, as a person would on github.com, and sends the app its installation created webhook. Returns the installation id.
listeningPort
function
listeningPort(server: Server): numberThe TCP port a listening server is bound to. Throws when the server is not listening yet, or is bound to a pipe or socket path rather than a port.
MicrosoftSeedConfig
type
Accounts, app registrations and their mail, calendars and files, to load into an emulator.
MicrosoftSeedEvent
interface
An event already in a seeded user's calendar. Times are UTC instants unless timeZone says.
MicrosoftSeedFile
type
A file or folder already in a seeded user's OneDrive, by path from the root.
MicrosoftSeedMessage
interface
A message already in a seeded user's mailbox.
microsoftSignIns
function
microsoftSignIns(emulator: Pick<Emulator, "store">): SignInsWho signed in to which app, for tests.
LlmCall
type
One call an app made to a model, as it was answered.
LlmCalls
interface
The calls the app made, in order, with their messages (key-shaped values scrubbed).
llmCalls
function
llmCalls(emulator: Emulator): LlmCallsThe calls the app made to OpenAI, Anthropic and the AI Gateway, oldest first.
LlmMatchInput
interface
When a script answers, as a seed or test gives it.
LlmRecordOptions
interface
How to record: where saved scripts live, and the real keys and hosts to ask.
LlmReply
interface
What the model answers: text, tool calls, a structured object (for a response_format or JSON response), or a refusal; stop ends it early, as running out of tokens or a content filter does. sources are the pages a search-backed answer cites; providers without citations leave them out. error answers with a provider error instead, so a test can fail a call on cue.
LlmScript
interface
A scripted answer: one reply, or several given out in turn (the last one repeating).
LlmScriptedError
type
An error a script answers with instead of a reply, in the provider's own shape and status: a 429 with its rate-limit headers, a 500, or the provider overloaded (529 on Anthropic, else 503).
LlmScripts
interface
Adds scripts from a test, after the seeded ones; clear removes every script.
llmScripts
function
llmScripts(emulator: Emulator): LlmScriptsScripts a test adds to the model API emulator while it runs.
LlmSeedConfig
interface
What the model API emulator starts with.
LlmToolCall
interface
One tool call a scripted reply makes; arguments is sent as JSON, or as is when a string.
OneDrive
interface
What oneDrive(emulator, user) reads: a user's OneDrive files.
oneDrive
function
oneDrive(emulator: Pick<Emulator, "store" | "outbox">, email: string): OneDriveOne user's OneDrive in a Microsoft emulator.
OutlookCalendar
interface
What outlookCalendar(emulator, user) reads: a user's Outlook calendar events.
OutlookMailbox
interface
What outlookMailbox(emulator, user) reads and does: a user's Outlook mail.
OutlookMessage
interface
A message as a test reads it.
outlookCalendar
function
outlookCalendar( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): OutlookCalendarOne user's Outlook calendar in a Microsoft emulator.
outlookMailbox
function
outlookMailbox( emulator: Pick<Emulator, "store" | "outbox">, email: string, ): OutlookMailboxOne user's Outlook mailbox in a Microsoft emulator.
PaystackBank
interface
A bank outside Paystack, for tests: money sent to a customer's dedicated account.
paystackBank
function
paystackBank(emulator: Pick<Emulator, "store" | "outbox">): PaystackBankA test's stand-in for a customer's bank, for paying into dedicated accounts.
PaystackLedger
interface
What a test reads back from a Paystack emulator: the money it moved and who it moved it for.
paystackLedger
function
paystackLedger(emulator: Pick<Emulator, "store">): PaystackLedgerReads back what a Paystack emulator holds: transactions, transfers, refunds, customers, subscriptions.
PaystackSeedConfig
type
Data to load into a Paystack emulator.
PubSubSeedSubscription
interface
A Pub/Sub push subscription: what Gmail publishes to topic is POSTed to endpoint.
revokeGoogleAccess
function
revokeGoogleAccess( emulator: Pick<Emulator, "store">, email: string, clientId?: string, ): voidRemoves the app's access as the user would from their Google Account: every token email holds for clientId (or for every client) is revoked, so API calls get 401 and refreshes get invalid_grant.
revokeMicrosoftSessions
function
revokeMicrosoftSessions(emulator: Pick<Emulator, "store">, email: string): numberSigns a user out of every app, as when they change their password or an admin revokes their sessions: refresh tokens fail with invalid_grant and Graph refuses their access tokens.
ResendInbox
interface
What resendInbox(emulator) reads: the mail the app sent through Resend.
resendInbox
function
resendInbox(emulator: Pick<Emulator, "store">): ResendInboxWhat the Resend emulator accepted, read the way a test reads a mailbox.
S3Objects
interface
What s3Objects(emulator) reads: the buckets and objects the app stored.
s3Objects
function
s3Objects(emulator: Pick<Emulator, "store">): S3ObjectsWhat the S3 emulator holds, read the way a test inspects a bucket.
PhoneMessage
interface
One text message a phone received, as a test reads it.
SignIn
interface
One account chosen on the sign-in page, as a test reads it.
SignIns
interface
Who signed in to which OAuth client, as googleSignIns and microsoftSignIns read it.
SlackAction
interface
A button or menu choice in a message.
SlackEphemeral
interface
An ephemeral message as a test reads it.
SlackMessage
interface
A message as a test reads it.
SlackSeedConfig
type
A workspace to load into a Slack emulator.
SlackWorkspace
interface
The workspace from a test's side: what apps posted, and members' actions that apps get told about. Members, channels and messages are named by id, email or name, and #channel or id.
slackWorkspace
function
slackWorkspace(emulator: Pick<Emulator, "store" | "outbox">): SlackWorkspaceThe workspace of a Slack emulator, for tests.
StoredObject
interface
One object the emulator holds, as a test reads it.
TwilioInbox
interface
What twilioInbox(emulator) reads: the texts sent to phones, by the app or by Verify.
twilioInbox
function
twilioInbox(emulator: Pick<Emulator, "store">): TwilioInboxThe texts the Twilio emulator sent to phones, read the way a test reads a phone.
TwilioPhone
interface
A person's phone in a test: texts it sends reach the app through the number's SMS URL.
twilioPhone
function
twilioPhone(emulator: Pick<Emulator, "store" | "outbox">): TwilioPhoneA phone texting the app's Twilio numbers, as a person would.
TwilioSeedConfig
type
Data to load into a Twilio emulator.
uninstallGithubApp
function
uninstallGithubApp( emulator: Pick<Emulator, "store" | "outbox">, installationId: number, ): voidRemoves an installation and sends the app its installation deleted webhook.
BachsDeposit
interface
A deposit someone makes into the account's virtual account. Amount as a decimal string.
BachsLedger
interface
What a test can read from and do to a Bachs emulator.
bachsLedger
function
bachsLedger(emulator: Emulator): BachsLedgerReads and drives a Bachs emulator from a test.
BachsSeedConfig
interface
Data to load into a Bachs emulator. Balances are decimal strings by currency, e.g. { USD: "500.00" }.
ComposioAccountView
interface
A connected account as tests see it.
ComposioExecution
type
One tool run, as the project's logs keep it.
ComposioProject
interface
A Composio project as tests read and drive it.
composioProject
function
composioProject(emulator: Pick<Emulator, "store" | "outbox">): ComposioProjectThe project a Composio emulator stands in for: its accounts, tool runs, triggers and expiries.
ComposioSeedConfig
type
Data to load into a Composio emulator.
ComposioToolHandler
type
Answers one tool's calls from test code: the data to return, or a full {@link ToolAnswer} to make the call unsuccessful, either one directly or as a promise.
ComposioTools
interface
Tool handlers of a Composio emulator, which answer before any seeded result or backend.
composioTools
function
composioTools(emulator: Pick<Emulator, "store">): ComposioToolsThe tool handlers of a Composio emulator, to answer tools from test code. A reset or restore drops them, so one test's handlers never answer the next test's calls.
NangoCall
interface
A proxied or action call as Nango received it, for tests to read.
NangoConnection
interface
A connection: one end user's account at an integration, with its credentials.
NangoProject
interface
Reading a Nango emulator from a test, and breaking a connection as a revoked app does.
nangoProject
function
nangoProject(emulator: Emulator): NangoProjectThe Nango environment an emulator stands in for.
NangoSeedConfig
type
Data to load into a Nango emulator. No webhooks are sent for seeded data.
NylasApplication
interface
The Nylas application a test reads and acts on; see nylasApplication.
nylasApplication
function
nylasApplication(emulator: Emulator): NylasApplicationThe Nylas application an emulator stands in for, for tests to read and act on.
NylasSeedConfig
type
Data to load into a Nylas emulator. No webhooks are sent for seeded data.
UnipileSeedConfig
type
Data to load into a Unipile emulator. No webhooks are sent for seeded data.
UnipileWorkspace
interface
Reading a Unipile emulator from a test, and acting as the people on the other side.
unipileWorkspace
function
unipileWorkspace(emulator: Emulator): UnipileWorkspaceThe Unipile workspace an emulator stands in for.
NovuExecution
interface
One triggered workflow run for one subscriber, with what each step did.
NovuMessage
interface
One message a step sent: an Inbox notification, an email, a text, a push or a chat message.
NovuProject
interface
A Novu emulator's workflows, messages and Inboxes as tests read them.
novuProject
function
novuProject(emulator: Pick<Emulator, "store">): NovuProjectA Novu emulator's project: subscribers, workflow runs, messages sent and open Inboxes.
NovuSeedConfig
type
Data to load into a Novu emulator.
PusherBeams
interface
A Pusher emulator's Beams side: what was published and which devices registered.
PusherChannels
interface
A Pusher emulator's Channels side as tests read and drive it.
PusherEvent
interface
One event published on a channel: by the API, by a client, or from a test.
pusherBeams
function
pusherBeams(emulator: Pick<Emulator, "store">): PusherBeamsThe Beams side of a Pusher emulator: notifications published, and the devices registered.
pusherChannels
function
pusherChannels(emulator: Pick<Emulator, "store">): PusherChannelsThe Channels side of a Pusher emulator: published events, live connections, test triggers.
PusherSeedConfig
type
Data to load into a Pusher emulator.
PUSHER_DEFAULTS
value
The app and Beams instance every Pusher emulator answers for, so a bare start works.
NOVU_DEFAULTS
value
The environment every Novu emulator answers for until a seed says otherwise.
TiptapCollabView
interface
A Tiptap emulator's documents and editors as tests read and drive them.
tiptapCollab
function
tiptapCollab(emulator: Pick<Emulator, "store">): TiptapCollabViewA Tiptap emulator's documents as JSON or text, who is editing them, and their faults.
TiptapSeedConfig
type
Data to load into a Tiptap emulator.
DatabaseSnapshot
interface
What an environment's snapshot() and restore() call, plus close() for its own connection. Each keeps a state per slot, so an environment with snapshotSlots passes its slot straight on: snapshot: (slot) => db.snapshot(slot).
postgresSnapshot
function
postgresSnapshot(options: PostgresSnapshotOptions): DatabaseSnapshotA snapshot of a Postgres database for an environment's snapshot() and restore(). Needs a role that may create databases, and Postgres 14 or later.
PostgresRestoreStrategy
type
How a restore brings the database back.
PostgresSnapshotOptions
interface
Which Postgres database postgresSnapshot keeps and brings back, and how.
postgresWorkerDatabase
function
postgresWorkerDatabase( url: string, workerIndex: number, options: WorkerDatabaseOptions = {}, ): Promise<string>A database of its own for one worker, <base>_w<workerIndex>, copied fresh from base, so parallel workers never share rows. Resolves to its connection URL. Run migrations and seeds on base first: nobody may be connected to it while the copy is made.
redisSnapshot
function
redisSnapshot(options: RedisSnapshotOptions): DatabaseSnapshotA snapshot of one Redis or Valkey database for an environment's snapshot() and restore().
RedisSnapshotOptions
interface
Which Redis or Valkey database redisSnapshot keeps and brings back.
sqliteSnapshot
function
sqliteSnapshot(options: SqliteSnapshotOptions): DatabaseSnapshotA snapshot of a SQLite database file for an environment's snapshot() and restore().
SqliteSnapshotOptions
interface
Which SQLite file sqliteSnapshot keeps and brings back, and where it keeps the copy.
sqliteWorkerFile
function
sqliteWorkerFile(file: string, workerIndex: number): Promise<string>A copy of a SQLite database for one worker, e.g. of a seeded database every worker starts from: await sqliteWorkerFile("seed.db", workerIndex) resolves to seed.w0.db. Made with SQLite's backup, so rows still in the write-ahead log are copied too.
WorkerDatabaseOptions
interface
Where postgresWorkerDatabase copies each worker's database from.
DataCall
interface
A call and how it ended.
DataCallStart
interface
A call as it starts, before the server answers: what a fault rule decides on.
DataFault
type
A fault on one call: - reset: the connection is dropped before the call reaches the server; - reset-after: the server runs the call, then the connection is dropped before the app sees the answer (on COMMIT: committed, but the app cannot know); - delay: the call reaches the server ms late; - error: the server is not asked; the app gets an error with code (a SQLSTATE such as 40001, or a Redis prefix such as OOM); - down: the connection is dropped and new ones fail for ms: refused outright, or, for Postgres, turned away with too_many_connections.
DataFaultRule
type
Picks the fault for a call as it starts, if any.
DataProxy
interface
A running data proxy: the address the app connects to instead of its database or cache.
defaultDataFaults
function
defaultDataFaults(call: DataCallStart): readonly DataFault[]danwo matrix's default data faults for a call, by the protocol it speaks.
pgError
function
pgError(name: keyof typeof POSTGRES_ERRORS): DataFaultA Postgres error fault by its name, e.g. pgError("serialization_failure").
POSTGRES_ERRORS
value
Postgres SQLSTATEs danwo injects, by the name reports use.
PostgresProxyOptions
interface
Fault proxies in front of the app's own database and cache: the app connects through proxy.url(realUrl), the environment lists them under data, and danwo matrix faults the statements and commands its tests send.
REDIS_ERRORS
value
Redis error replies danwo injects, by prefix.
redisError
function
redisError(prefix: keyof typeof REDIS_ERRORS): DataFaultA Redis error reply fault by its prefix, e.g. redisError("OOM").
RedisProxyOptions
interface
Fault proxies in front of the app's own database and cache: the app connects through proxy.url(realUrl), the environment lists them under data, and danwo matrix faults the statements and commands its tests send.
startPostgresProxy
function
startPostgresProxy(options: PostgresProxyOptions): Promise<DataProxy>Starts a proxy in front of a Postgres server. Point the app at proxy.url(databaseUrl) instead of the database; every statement it sends is then recorded and can be faulted. TLS between the app and the database is declined, so the app must allow a plain connection (sslmode=disable or prefer, the default for most drivers).
startRedisProxy
function
startRedisProxy(options: RedisProxyOptions): Promise<DataProxy>Starts a proxy in front of a Redis server. Point the app at proxy.url(redisUrl) instead of the server; every command it sends is then recorded and can be faulted. TLS (rediss://) is not supported through the proxy.
ClerkEnvironment
type
What clerkEnvironment() starts: the Clerk emulator behind its own proxy.
clerkEnvironment
function
clerkEnvironment( options: ClerkOptions & { readonly unmatched?: "passthrough" | "block" } = {}, ): Promise<ClerkEnvironment>A worker-scoped Clerk emulator behind its own proxy; combine services with startServices.
clerkMail
function
clerkMail(emulator: Pick<Emulator, "store">): MailSourceEmails the Clerk emulator sent: sign-in and sign-up verification codes, read like any mail, so mail.code(email) and a recorded typed code work for Clerk's <SignIn/> and Account Portal.
ClerkOptions
interface
Options of clerkService() and clerkEnvironment().
clerkService
function
clerkService(options: ClerkOptions = {}): OAuthServiceClerk for startServices: a development instance on its real hosts. The app's server reaches the Backend API on api.clerk.com; the browser loads ClerkJS and <SignIn/> from the Frontend API on <slug>.clerk.accounts.dev, or signs in on the Account Portal at <slug>.accounts.dev, through the same proxy. With social, its "Continue with Google" signs in on the Google emulator. Its webhooks go to the seeded endpoints, signed the Svix way. Gives tests the clerk fixture (read keys, sessions and codes with clerkInstance(clerk)), and the codes it emails reach the mail fixture and the agent.
ClerkInstance
interface
The instance an emulator plays: its slug, keys and the hosts derived from them.
clerkInstance
function
clerkInstance(emulator: Pick<Emulator, "store">): ClerkInstanceViewThe Clerk emulator's instance, users, sessions and sent codes, for tests.
ClerkInstanceView
interface
What a test can read and do on a Clerk emulator.
ClerkMembershipView
interface
A user's membership in an organization, with their role in it.
ClerkMessage
interface
An email Clerk sent: verification codes and sign-in links, read by tests.
ClerkSeedConfig
interface
A Clerk emulator's seed: the instance, and the users, organizations and JWT templates it starts with.
ClerkSeedOrganization
interface
A seeded organization and its members by email; the first admin creates it. Its id is id when given, otherwise derived from its slug (or name), stable across runs like a user's.
ClerkSeedTemplate
interface
A seeded JWT template.
ClerkSeedUser
interface
A seeded user: an email address, and a password unless sign-in is by emailed code. Its id is id when given, otherwise derived from the email address, so it is the same on every run and after every reset, and matches rows an app's own database was seeded with.
ClerkEmailView
interface
An email address on a user, and how it was verified.
ClerkOrganizationView
interface
An organization as the Backend API answers it.
ClerkSessionView
interface
A session as the Backend API answers it: active until it ends, is revoked or expires.
ClerkUserView
interface
A user as the Backend API answers it; times are milliseconds since the epoch.
stableClerkId
function
stableClerkId(prefix: string, name: string): stringA Clerk-style id derived from name, the same on every run and after every reset, e.g. stableClerkId("user", "[email protected]"): seeded records keep the ids an app's own database was seeded with.