Skip to content

feat: implement comprehensive automated testing framework#21

Merged
robertocarlous merged 1 commit intoNeurowealth:mainfrom
Kaylahray:test-suite
Mar 9, 2026
Merged

feat: implement comprehensive automated testing framework#21
robertocarlous merged 1 commit intoNeurowealth:mainfrom
Kaylahray:test-suite

Conversation

@Kaylahray
Copy link
Copy Markdown
Contributor

@Kaylahray Kaylahray commented Mar 9, 2026

feat: implement comprehensive automated testing framework

Closes #9

image

What was done

Built the full automated testing framework as specified in the issue,
covering all backend modules with no real external API calls in unit tests.

Test structure

tests/
├── unit/
│ ├── nlp/parser.test.ts
│ ├── nlp/responses.test.ts
│ ├── agent/scanner.test.ts
│ ├── agent/router.test.ts
│ ├── stellar/client.test.ts
│ ├── middleware/errorHandler.test.ts
│ └── whatsapp/
│ ├── handler.test.ts
│ └── userManager.test.ts
├── integration/
│ ├── api/auth.test.ts
│ ├── api/portfolio.test.ts
│ ├── api/transactions.test.ts
│ ├── api/deposit.test.ts
│ └── whatsapp/webhook.test.ts
└── helpers/
├── testDb.ts
└── factories.ts

Results

Metric Result Threshold
Tests 254 / 254 passing
Lines 93.19% 80% ✅
Functions 94.28% 80% ✅

Changes

  • jest.config.ts — TypeScript Jest config with coverage thresholds and forceExit
  • package.json — added test and test:coverage scripts
  • .github/workflows/ci.yml — runs tests + coverage on every PR, uploads
    coverage artifact, fails build if thresholds not met
  • Backend/.gitignore — added coverage/ exclusion
  • src/controllers/auth-controller.ts / src/middleware/authenticate.ts
    switched from new PrismaClient() to the shared db singleton so
    jest.mock('../db') correctly intercepts all database calls in tests,
    preventing real Postgres connections during unit tests

@robertocarlous robertocarlous merged commit 4ad0eae into Neurowealth:main Mar 9, 2026
1 check passed
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.

[backend] [testing] Write complete backend test suite with Jest

2 participants