Skip to content

Add comprehensive test coverage and GitHub Actions CI - #1

Open
jerome-cbmb wants to merge 1 commit into
mainfrom
jerome/add-tests-and-ci
Open

Add comprehensive test coverage and GitHub Actions CI#1
jerome-cbmb wants to merge 1 commit into
mainfrom
jerome/add-tests-and-ci

Conversation

@jerome-cbmb

Copy link
Copy Markdown
Collaborator

What

Adds 118 tests across 6 test files covering all pure-logic library modules, plus a GitHub Actions CI workflow.

Test Coverage Added

Module Tests What's Covered
financial-metrics.ts 44 Core metrics, trends, category breakdown, balance sheet (existing)
transaction-classifier.ts 19 Classification logic, internal transfer detection, CC payment detection, cash flow filtering
financial-analysis.ts 16 Spending analysis, category breakdown, merchant aggregation, recurring charge detection
financial-statement.ts 18 Statement building, income/expense allocation, subcategory mapping, date range presets
context-builder.ts 13 Context string generation, section formatting, limits/truncation
utils.ts 8 cn() tailwind class merging utility

CI Workflow

.github/workflows/ci.yml runs on every PR and push to main:

  1. TypeScript typecheck (npm run typecheck)
  2. Lint (npm run lint)
  3. Tests (npm test)

Notes

  • Tests focus on pure logic functions only — no mocking of external services (Plaid, Supabase, Claude API)
  • Set TZ=UTC in vitest config to avoid timezone-dependent date parsing in financial-statement.ts (generateMonthRange uses new Date() with date-only strings which parse as UTC midnight, causing month shifts in non-UTC timezones)
  • All tests pass, typecheck passes

- Add test suites for all pure-logic library modules:
  - transaction-classifier (19 tests): classification logic, internal transfer detection, CC payment detection, cash flow filtering
  - financial-analysis (16 tests): spending analysis, category breakdown, merchant aggregation, recurring charge detection
  - financial-statement (18 tests): statement building, income/expense allocation, subcategory mapping, date range presets
  - context-builder (13 tests): context string generation, section formatting, limits/truncation
  - utils (8 tests): cn() tailwind class merging utility

- Total: 118 tests (74 new + 44 existing) across 6 test files

- Add .github/workflows/ci.yml: runs typecheck, lint, and tests on PR and push to main

- Set TZ=UTC in vitest config to avoid timezone-dependent date parsing in financial-statement.ts (generateMonthRange uses new Date() with date-only strings)
@vercel

vercel Bot commented Feb 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
basis-app Ready Ready Preview, Comment Feb 2, 2026 5:39am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant