Skip to main content

Testing

API tests are Jest, config test/jest.json. AGENTS.md puts feature specs in test/modules/. An example that already exists is test/modules/fulfillment-state-machine.spec.ts.

yarn test
yarn test:cov
yarn test:debug
yarn verify
yarn architecture:check
yarn verify:test-pairs

yarn verify is the gate: lint, Prettier, typecheck, build, test. Pre-commit runs lint-staged through Husky.

What to test in this codebase​

  • State-machine maps, including edges the header comment omits.
  • A service transaction that must enqueue an outbox row with the same client.
  • Permission metadata present on a route that should not be public-to-authenticated.
  • A new model listed in the tenancy extension. The architecture spec fails when it is missing.

Admin tests are Vitest (pnpm verify). The warehouse package has no test script in the package.json that was read.

Do not point tests at production credentials. Demo seed password fallbacks stay out of fixtures that get committed into docs.