| name | run-tests |
| description | Run and verify tests for the DNA project. Use when making code changes, running tests, checking coverage, or when the user asks to test changes. Covers both backend (pytest via Docker) and frontend (Vitest) testing workflows. |
Run Tests
Quick Reference
| Component | Command | Working Directory |
|---|
| Backend | make test | backend/ |
| Frontend (all) | npm run test-ci | frontend/ |
| Frontend (watch) | npm run test | frontend/ |
Backend Testing
Backend uses pytest with pytest-cov, running inside Docker.
cd backend
make test
Coverage Commands
make test-cov
make test-cov-html
Coverage Requirement
Backend tests must maintain at least 90% coverage.
After Backend Changes
Always run make format-python after making backend changes:
cd backend
make format-python
Frontend Testing
Frontend uses Vitest for both @dna/core and @dna/app packages.
Run All Tests
cd frontend
npm run test-ci
npm run test
Run with Coverage
npm run test:coverage
Run Specific Package
npm run test --workspace=@dna/core
npm run test --workspace=@dna/app
Test File Conventions
| Component | Pattern | Location |
|---|
| Backend | test_*.py | backend/tests/ |
| Frontend | *.test.ts or *.test.tsx | Alongside source or in __tests__/ |
Workflow
When making changes:
- Make your code changes
- Run the appropriate tests:
- Backend changes:
make test from backend/
- Frontend changes:
npm run test-ci from frontend/
- Fix any failing tests
- For backend: run
make format-python
- Verify coverage meets requirements (90% for backend)