Synq
Skip to content
[ synq / docs ]Synq home

Testing strategy

Unit, integration, security, contract and end-to-end suites, and how they are run.

Synq tests the properties it promises, not only the code paths. Most suites run offline; the ones that need services say so.

Suites#

SuiteCommandNeedsWhat it covers
Unitcorepack pnpm testNothingEvery *.test.ts outside integration: domain, Kernel, schemas, plugins, channels, contracts (TypeScript side), fixtures
Contracts (TypeScript)corepack pnpm exec vitest run tests/contractsNothingThe v3 API contract, generated OpenAPI/Swift/fixtures in step with the schemas, and the API reference drift test
Smart contractscorepack pnpm test:contractsFoundry (forge)forge build and forge test offline: unit, fuzz (256 runs) and invariant tests (depth 64, fail on revert) for every Solidity contract, plus a Monad fork profile
Integrationcorepack pnpm test:integrationFoundry, Anvil, Postgres, Redis (corepack pnpm infra:up), Temporal dev server for workflow testsReal Postgres stores, a local Anvil chain with deployed contracts, crash recovery, reorgs, durable outboxes, the API with real sessions
Securityfiles under tests/security, tests/gauntletSame as integrationAbuse tests for the app API (sessions, leads, events and notifications, Amane), Kernel critic tests, and integrated attack scenarios
Plugin contractscorepack pnpm test:pluginsNothingEvery plugin satisfies the plugin contract
Schema compatibilitycorepack pnpm test:schema-compatNothingReference examples still parse
Workflowcorepack pnpm test:workflowTemporal dev serverWorkflow replay and activities
Brain and worldcorepack pnpm test:brainNothingReasoner ports and the world model
Web end to endcorepack pnpm test:e2ePlaywright, built web appApproval signing flows in a browser
Testnetcorepack pnpm test:testnetA funded testnet key file and RPCLive Arc testnet scenarios; never run in CI
Live providertest:live:* scriptsProvider credentialsOpt-in checks against sandbox providers
Indexercorepack pnpm test:indexerEnvio fork environmentThe Envio indexer

What the tests prove#

  • Authorization is exact. Tests mutate recipients, amounts, calldata, chain and expiry of grants and expect refusal.
  • Exactly once. Crash-recovery tests kill the worker at each instrumented point and assert one broadcast.
  • Isolation. Abuse tests call every route as the wrong tenant, the wrong role, with a stale session or a replayed refresh token, and expect 404 or 401, not data.
  • Redaction. Notification tests assert titles and push payloads never contain names, prices or addresses.
  • Contracts enforce independently. Foundry fuzz and invariant tests attack the vault policy, the escrow and the mandate registry with random call sequences.
  • Contracts and docs match the code. tests/contracts/app-api.test.ts checks the generated OpenAPI, Swift models and fixtures against the Zod schemas; tests/contracts/docs-api.test.ts checks the committed API reference against a fresh generation.

Reports#

corepack pnpm test:report P01 runs the unit suite with machine-readable results under reports/tests, which CI uploads as an artifact. The vitest config runs two workers at a time. See Running the test suites for setup.

Edit this page on GitHub