ORRANGE / Developer
Testing
Three commands cover correctness: unit tests, a strict typecheck, and a production build.
npm test
npx tsc --noEmit
npm run buildnpm test— Vitest unit/integration suite (Node environment).npx tsc --noEmit— strict TypeScript check. Run it afternpm run build(the build regenerates.next/types, which the standalone check references).npm run build— production build with prerendering.
What the tests protect
| Layer | Area |
|---|---|
| AI schema | Structured proposal validation — including rejection of model-injected constraints and malformed insight. |
| Policy | Deterministic checks: destination allowlist, self-transfer rejection, concentration, liquidity, max-tx. |
| Financial exactness | Exact 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 gate | executeProposal — expiry, state-change, fresh-price, and policy-rejection paths. |
| Simulation | simulateAction before/after economics and the advisory/estimated flag. |
| Health | Health score, risk levels, request-vs-policy conflict detection. |
| STRK20 identity | The Ready-derived address is the SDK user — and is not the SDK Shadow Account. |
| Docs navigation | Every 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.