Skip to content

Scenario test file

A scenario test file walks the Startup end to end with test keys, as a buyer who orders, pays and accepts would.

PropertyValue
Pathtests/[scenario].test.ts
HoldsStartup
Kindfile
Leadersdb-first, git-first
TeamQuality Team
Written byNone.
Compiled byStartupBuilder

Example

tests/first-close.test.ts in a Startup repository.

tests/first-close.test.ts
import { clock, expect, test, walk } from 'startup-builder/test'

test('an agency that subscribes gets its first month closed', async () => {
  const agency = await walk('client')
  await agency.subscribe('monthly-close')
  await agency.import('mappings/bank-statement', 'fixtures/september.csv')
  await clock.advance('5 days')
  expect(await agency.inbox()).toContainMessage('Your books for 2026-09 are closed')
})