Skip to content

[Backend] Unit and integration tests for all API routes #14

Description

@Gbangbolaoluwagbemiga

Overview

The backend has zero tests. All routes need happy-path and error-path coverage.

Setup

```bash
cd backend && npm install -D vitest supertest @types/supertest
```

Add to `backend/package.json`: `"test": "vitest run"`

Mock Supabase and Groq via `vi.mock()`.

Routes to test

Route Happy path Error paths
`POST /messages` stored invalid body, unauthorized
`GET /inbox/:address` conversations returned bad address, empty inbox
`POST /notifications` created invalid payload
`GET /notifications/:address` list returned not found

Acceptance criteria

  • `npm test` in `backend/` passes
  • ≥ 70% line coverage
  • Tests run in CI

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendNode.js / Express / Supabase worktestingTest coverage improvements

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions