Testing with Mocks
Mocks in CI
Structure deterministic contract tests and keep the live-provider swap small.
A launch-grade contract test should:
- Start only the provider apps it needs on port 0.
- Seed a named deterministic scenario.
- Configure manifest-declared adapter base URLs.
- Resolve
fixture:*credentials throughMockCredentialProvider. - Call the normal executor with canonical input.
- Assert output, execution state, provider-side state, and sanitized errors.
- Advance the mock clock for asynchronous transitions.
- Reset or close the server in teardown.
Run the separate workspace checks:
Bash
pnpm --dir mocks build
pnpm --dir mocks typecheck
pnpm --dir mocks lint
pnpm --dir mocks testReal-auth swap invariant
The live smoke test changes only provider base URLs and credential resolution. Canonical inputs, adapter code, executor configuration, schemas, assertions, and the core contract-test body stay the same.