The test suite on main could not compile (stray vitest imports; alias @/ imports
emitted as unresolvable CJS requires in the node:test build). Restoring it surfaced
latent failures in tests that had never actually run. Decisions taken:
-
test/integration-health.test.tswhitespace case — the committed test setINTEGRATION_API_KEY = '***'(a non-whitespace placeholder) while asserting the "whitespace → not configured" behavior. Assumed the test name states the intent: the value was changed to a real whitespace string andisGatewayConfigured()now trims (Boolean(key?.trim())). Server-side only; a whitespace-only key could never have produced a working gateway client. -
test/features.test.tsexpectations aligned to shipped config — the test expectedadminPolicies/resourcesto default totruein live mode and malformed flag values to fall back to defaults.lib/config.ts(older than the test, and matching CLAUDE.md: flags default to true in mock mode only) defaults them tofalsein live mode and treats any value other than"true"as false. The tests never passed as written; they were updated to assert the shipped, documented behavior rather than changing production feature gating. -
test/fixtures/live-api-responses.tsparity refresh — mock data gained profile badges and resourcecontentblocks (resource-content-renderer PR) without the live fixtures being updated, breaking the mock/live contract tests. Fixtures were extended to match; no runtime code changed. -
Alias imports in the test-compile closure —
@/…imports in files compiled intotest-distwere converted to relative paths (identical resolution for the Next build, resolvable under plain node). Type-only alias imports were left alone (erased at compile time). -
Out of scope: pre-existing
mainbreakage — ~35 typecheck errors and 3 lint errors remain onmainfrom an unrelated bad merge (7a93fa5revertedlib/wallet/providers.tsxto an old SIWE context shape and guttedcomponents/admin-guard.tsx;Select/Label/EmptyState/mapVerificationStateusages lost their imports/definitions; readonly wagmi config mismatch). Confirmed with the user (2026-07-17) that this branch fixes only its own scope; the merge regression needs its own PR. Gate used instead:npm testfully green + zero new typecheck/lint errors in files touched by this branch.Also pre-existing on
main(verified against files untouched by this branch):npm run check-typesfails (drift betweenlib/api/types.tsandtest/fixtures/openapi.json), andnpm run buildfails (@/components/ui/labelmodule missing, imported byapp/developer/page.tsx).