docs: add development database and testing documentation
This commit is contained in:
@@ -161,6 +161,46 @@ DATABASE_URL="postgresql://username:password@localhost:5432/euchre_camp"
|
||||
DATABASE_SHADOW_URL="postgresql://username:password@localhost:5432/euchre_camp_shadow"
|
||||
```
|
||||
|
||||
## Development Database
|
||||
|
||||
For development and testing, use a separate development database to avoid conflicts with production data.
|
||||
|
||||
**Setup Development Database:**
|
||||
|
||||
```bash
|
||||
# Create and setup the development database
|
||||
npm run db:setup-dev
|
||||
|
||||
# Reset the development database (drops and recreates)
|
||||
npm run db:reset-dev
|
||||
|
||||
# Clean development database (drop and recreate with migrations)
|
||||
npm run db:setup-dev:clean
|
||||
```
|
||||
|
||||
**Environment Configuration:**
|
||||
|
||||
The development database uses `.env.development` which is automatically configured for:
|
||||
- Database: `euchre_camp_dev`
|
||||
- NODE_ENV: `development`
|
||||
|
||||
**Testing with Development Database:**
|
||||
|
||||
```bash
|
||||
# Run unit tests (uses test database automatically)
|
||||
npm run test
|
||||
|
||||
# Run acceptance tests (uses development database)
|
||||
npm run test:acceptance
|
||||
```
|
||||
|
||||
**Test Data Cleanup:**
|
||||
|
||||
All tests automatically clean up their created records:
|
||||
- Global setup/teardown handles Playwright tests
|
||||
- Test utilities provide `cleanupTestRecords()` for manual cleanup
|
||||
- Tests use `beforeEach` and `afterEach` hooks for automatic cleanup
|
||||
|
||||
## Usage
|
||||
|
||||
### Creating a Tournament
|
||||
|
||||
Reference in New Issue
Block a user