ORRANGE / Developer

Testing

Three commands cover correctness: unit tests, a strict typecheck, and a production build.

npm test
npx tsc --noEmit
npm run build
  • npm test — Vitest unit/integration suite (Node environment).
  • npx tsc --noEmit — strict TypeScript check. Run it after npm run build (the build regenerates .next/types, which the standalone check references).
  • npm run build — production build with prerendering.

What the tests protect

LayerArea
AI schemaStructured proposal validation — including rejection of model-injected constraints and malformed insight.
PolicyDeterministic checks: destination allowlist, self-transfer rejection, concentration, liquidity, max-tx.
Financial exactnessExact bigint amount parsing and boundary tests (one smallest unit over balance, cents-over-cap).
Route boundary/api/ai/analyze — request validation, unknown-token rejection, JSON-safe serialization, user policy selection.
Treasury execution gateexecuteProposal — expiry, state-change, fresh-price, and policy-rejection paths.
SimulationsimulateAction before/after economics and the advisory/estimated flag.
HealthHealth score, risk levels, request-vs-policy conflict detection.
STRK20 identityThe Ready-derived address is the SDK user — and is not the SDK Shadow Account.
Docs navigationEvery sidebar route points to a real page and is unique.
No test count is printed here because it changes as the suite grows. Run npm test to see the current number; the suite must be green before a merge.