This commit is contained in:
Eric Gullickson
2025-11-04 18:38:06 -06:00
parent d8d0ada83f
commit d4156cf521
20 changed files with 1149 additions and 186 deletions

View File

@@ -21,20 +21,18 @@ backend/src/features/[name]/tests/
## Docker Testing Workflow
### Primary Test Command
```bash
# Run all tests (backend + frontend) in containers
make test
```
### Backend Testing
This executes:
- Backend: `docker compose exec mvp-backend npm test`
- Frontend: runs Jest in a disposable Node container mounting `./frontend`
### Feature-Specific Testing
```bash
# Test single feature (complete isolation)
# Enter backend container shell
make shell-backend
# Inside container:
# Test all features
npm test
# Test single feature (complete isolation)
npm test -- features/vehicles
# Test specific test type
@@ -44,8 +42,21 @@ npm test -- features/vehicles/tests/integration
# Test with coverage
npm test -- features/vehicles --coverage
# Frontend only
make test-frontend
# Watch mode
npm run test:watch
```
### Frontend Testing
```bash
# From project root, run tests in frontend container
docker compose exec mvp-frontend npm test
# Watch mode
docker compose exec mvp-frontend npm run test:watch
# With coverage
docker compose exec mvp-frontend npm test -- --coverage
```
### Test Environment Setup
@@ -247,12 +258,14 @@ npm test -- --detectOpenHandles
### Pre-commit Testing
All tests must pass before commits:
```bash
# Run linting and tests
# Backend: Enter shell and run tests
make shell-backend
npm run lint
npm test
# In Docker environment
make test
# Frontend: Run tests from project root
docker compose exec mvp-frontend npm run lint
docker compose exec mvp-frontend npm test
```
### Feature Development Workflow