Testing
What is tested, how to run it, and what a change must pass before it ships.
The Suite
Vitest runs every lib/**/*.test.ts in a Node environment with server-only stubbed. There are more than 70 test files and more than 800 tests. They cover the pure logic: intake step rules, readiness and completeness, matching eligibility and gates, the tour script, the suggestion ranking, the email audience rule, the navigation registries, the route gate, the design-system guards, and the mappings from answers to profiles.
npm test # the whole suite
npx vitest run lib/matching # one folder
npx vitest watch # while developingThe Gate
Every push passes, in this order:
npx tsc --noEmitclean.npm testgreen.- No em or en dash in any added line.
Then rebase onto origin/main and push.
What Is Not Unit Tested
Pages, components and server actions are not covered by the suite. They are checked by the type checker, by npm run build, and by walking the feature on production after deploy. Clerk's sign-in widget does not load in a headless browser against a local server, so anything behind sign-in is verified on production or with a real browser session.
Tests That Guard Conventions
lib/ui-library.test.tsfails if acomponents/uifile imports Radix, ifasChildappears outside the tour, or if a hand patch to sidebar, dialog, select, command or toast is lost.lib/phone-shell.test.tspins the phone layout of the sidebar and dialogs.lib/tour/steps.test.tspins that the welcome card's step count matches the number of steps.- The navigation tests pin that every route in the registries has an audience and that the longest match wins.
When one of these fails, the fix is almost never to change the test.
Writing a Test
Put the pure part of the change in its own file in lib/<domain>/ and test it beside it. Name the test after the behavior ("a founder is ready without skills; a supporter is not"), reference the ticket in the name when it fixes a finding, and keep the fixture minimal.
Acceptance Testing
Impact Hub Houston walks each role on production after a round of changes and records findings in a sheet; each finding becomes a Linear ticket and is closed with a comment saying how it works now. That sheet is the acceptance record for a phase.

