Skip to content

test: add frontend and backend unit tests#20

Merged
doublesilver merged 1 commit into
mainfrom
feat/add-tests
Mar 2, 2026
Merged

test: add frontend and backend unit tests#20
doublesilver merged 1 commit into
mainfrom
feat/add-tests

Conversation

@doublesilver
Copy link
Copy Markdown
Owner

Summary

  • Add 14 frontend tests (Vitest + React Testing Library): API utils, page rendering, loading states, validation, ARIA, metrics
  • Add 22 backend tests (pytest): chunk_text, local_embed, similarity, normalize_vector, build_prompt, load_settings
  • Configure Vitest with esbuild JSX automatic runtime (no plugin dependency needed)
  • Total: 38 tests, all passing

Test plan

  • npx vitest run → 14/14 passed
  • pytest tests/ -v → 24/24 passed (including 2 existing)
  • Build still works (npm run build)

🤖 Generated with Claude Code

- Frontend (Vitest + React Testing Library): 14 tests
  - lib.test.ts: ENDPOINT, ApiError, fetchApi coverage
  - page.test.tsx: render, loading, validation, ARIA, metrics
- Backend (pytest): 22 tests
  - test_rag.py: chunk_text, _local_embed, similarity, normalize_vector, build_prompt, load_settings
- Configure vitest with esbuild JSX automatic runtime
- Add test script to package.json

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 28, 2026

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

Project Deployment Actions Updated (UTC)
knowledge-copilot Building Building Preview, Comment Feb 28, 2026 11:16am

@doublesilver doublesilver merged commit 477da63 into main Mar 2, 2026
5 checks passed
@doublesilver doublesilver deleted the feat/add-tests branch March 2, 2026 08:35
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