Skip to content

Add backend integration test setup with vitest#166

Open
DevalGarg129 wants to merge 1 commit into
0rigin-c0de:mainfrom
DevalGarg129:feature/backend-test
Open

Add backend integration test setup with vitest#166
DevalGarg129 wants to merge 1 commit into
0rigin-c0de:mainfrom
DevalGarg129:feature/backend-test

Conversation

@DevalGarg129
Copy link
Copy Markdown

Summary

Added backend integration testing setup for the Express + Mongoose backend using Vitest, Supertest, and mongodb-memory-server.

What Changed

Testing Infrastructure

  • Added Vitest configuration for backend integration testing
  • Added isolated in-memory MongoDB test setup
  • Added reusable backend test environment
  • Added npm test command support

Backend Integration Tests

Implemented integration tests for:

  • Auth route protection flow
  • Friend request flow
  • Friend request processing flow
  • Direct message unauthorized send flow
  • Direct message unauthorized fetch flow

Developer Experience

  • Tests now run without requiring production MongoDB Atlas credentials
  • Added isolated database cleanup between test runs
  • Added contributor-friendly backend testing workflow

Why

This improves backend reliability and makes future contributions safer by providing a consistent integration testing setup for maintainers and contributors.

Testing

Run backend tests with:

cd server
npm test

All tests pass successfully using an isolated in-memory MongoDB instance.

<issue: 23>

@DevalGarg129 DevalGarg129 requested a review from 0rigin-c0de as a code owner May 24, 2026 13:42
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 24, 2026

@DevalGarg129 is attempting to deploy a commit to the Sunil Kumar's projects Team on Vercel.

A member of the Team first needs to authorize it.

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