Skip to content

test: add unit test coverage for API routes and lib utilities - #633

Merged
berry-13 merged 1 commit into
mainfrom
fix/api-test-coverage
Jun 20, 2026
Merged

berry-13 merged 1 commit into
mainfrom
fix/api-test-coverage

Conversation

@berry-13

Copy link
Copy Markdown
Collaborator

Summary

Adds a Vitest-based unit test suite covering the API routes, server actions, and shared library utilities, and wires it into CI.

  • New vitest setup (vitest.config.ts) with a @ path alias and Node test environment
  • test / test:watch scripts in package.json
  • A dedicated Unit tests step in the CI workflow (pnpm test)

Coverage

Area Tests
app/api/chat route request handling, validation, rate limiting
app/api/subscribe route subscription flow
app/api/unsubscribe route unsubscribe flow
app/actions/feedback server action feedback submission
lib/rate-limit rate-limiting helper
lib/supabase client helper

Shared test setup lives in __tests__/helpers.ts.

Verification

Test Files  6 passed (6)
     Tests  41 passed (41)

Add a vitest setup and unit tests covering the chat, subscribe, and
unsubscribe API routes, the feedback server action, and the rate-limit
and supabase helpers. Wire the suite into CI as a dedicated unit-test
step.
@vercel

vercel Bot commented Jun 20, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
librechat-ai Ready Ready Preview, Comment Jun 20, 2026 10:01pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📦 Next.js Bundle Analysis for librechat.ai

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@berry-13
berry-13 merged commit 86a7e96 into main Jun 20, 2026
5 checks passed
@berry-13
berry-13 deleted the fix/api-test-coverage branch June 20, 2026 22:15

This branch was successfully deployed

1 active deployment
Preview — 5f2e6538 Deployed Jun 20, 2026 by vercel[bot]
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