Summary
apps/web-app currently has no test infrastructure at all — there is no test script in package.json and not a single *.test.* / *.spec.* file across src/. This means every hook and utility (including financial calculations) ships unverified, and contributors have no harness to add regression tests to.
This issue sets up the testing foundation and lands the first few high-value tests.
Scope
- Add Vitest + React Testing Library (with
jsdom) to apps/web-app, wired into the Turborepo test pipeline.
- Add a
test (and test:watch) script to apps/web-app/package.json.
- Write the first unit tests for critical, pure-ish logic:
apps/web-app/src/features/borrowing/hooks/useHealthFactor.ts — health-factor math
apps/web-app/src/lib/utils.ts — cn() and any pure helpers
- One more hook/util of the contributor's choice with clear input/output
Acceptance criteria
Notes
Keep the first PR focused on the harness + a small set of exemplary tests so future contributors have a clear pattern to copy. Broad coverage of all 90+ components is explicitly out of scope here.
Summary
apps/web-appcurrently has no test infrastructure at all — there is notestscript inpackage.jsonand not a single*.test.*/*.spec.*file acrosssrc/. This means every hook and utility (including financial calculations) ships unverified, and contributors have no harness to add regression tests to.This issue sets up the testing foundation and lands the first few high-value tests.
Scope
jsdom) toapps/web-app, wired into the Turborepotestpipeline.test(andtest:watch) script toapps/web-app/package.json.apps/web-app/src/features/borrowing/hooks/useHealthFactor.ts— health-factor mathapps/web-app/src/lib/utils.ts—cn()and any pure helpersAcceptance criteria
npm run test(and the Turbotesttask) runs Vitest inapps/web-appand passesvitest.config.ts, setup file)Notes
Keep the first PR focused on the harness + a small set of exemplary tests so future contributors have a clear pattern to copy. Broad coverage of all 90+ components is explicitly out of scope here.