Skip to content

Testing API

Every block below is compared character by character with the source files named above. If they drift apart, the documentation build fails.

# @identity-flow/testing

export function workflowTest<

workflowTest(options) returns an ordinary Vitest test function — describe, beforeEach, and everything else you already use still work.

Each test gets three extras: a driver that can act as any account you declared, those accounts, and a typed registry for replacing bindings. In managed mode it runs against real PostgreSQL with one schema per test, so tests don’t see each other’s data.

createHookTestHost() exercises hook definitions with no database, no container, and no network. It’s fast, so hook tests can run on every save.

Keep those assertions in their own tests. Mixing them into a workflow test buys you nothing and makes both slower to diagnose.

Runnable examples: Testing Workflows.