cd backend
pytest tests/ -vpytest tests/ --cov=app --cov-report=htmlCoverage report generated in htmlcov/index.html
backend/tests/
├── conftest.py # Test fixtures and configuration
├── test_main.py # API endpoint tests
├── test_gemini_service.py # AI service tests
├── test_integration.py # Integration tests
└── test_fasting.py # Fasting feature tests
- Total tests: 85
- Coverage: 74.5%
- All critical paths tested
cd frontend
npm testnpm run test:watchnpm run test:uinpm run test:coveragefrontend/src/
├── components/
│ └── __tests__/ # Component tests
├── services/
│ └── __tests__/ # Service tests
└── pages/
└── __tests__/ # Page tests
- Total tests: 137
- Passing: 137
- Coverage: 60.4%
- Framework: Vitest + React Testing Library
Tests run automatically via GitHub Actions on:
- Pull requests
- Pushes to main branch
See .github/workflows/ci.yml for CI configuration.
def test_search_food(client):
response = client.get("/api/search-food?query=apple")
assert response.status_code == 200
assert "foods" in response.json()import { render, screen } from '@testing-library/react'
import { Login } from './Login'
test('renders login form', () => {
render(<Login />)
expect(screen.getByText('Sign In')).toBeInTheDocument()
})Ensure virtual environment is activated:
source venv/bin/activate # macOS/Linux
venv\Scripts\activate # WindowsClear cache and reinstall:
rm -rf node_modules
npm installCheck:
- Environment variables are set in GitHub Secrets
- Dependencies are correctly specified in
requirements.txtandpackage.json - No system-specific paths in tests
Next: Deployment