
Test Database Feature
- 1 installs
- 84 repo stars
- Updated August 4, 2026
- aws-samples/review-and-assessment-powered-by-intelligent-documentation
test-database-feature is a testing skill that runs RAPID backend repository integration tests against a local MySQL database using Docker Compose and Prisma.
About
This skill runs repository integration tests against a local MySQL database for the RAPID backend. It covers starting the database with Docker Compose, generating and migrating the Prisma client, and writing Vitest integration tests that connect to the actual database. A developer uses it after adding repository methods, changing the Prisma schema, or testing database-dependent use cases. It also lists the test-organization layout and Prisma tooling commands.
- Runs repository integration tests against a real local MySQL database (not mocks) for the RAPID backend
- Includes Docker Compose DB setup, Prisma generate/migrate, and a Vitest integration test pattern
- Provides a quick-command table for starting, stopping, resetting, and inspecting the database
Test Database Feature by the numbers
- 1 all-time installs (skills.sh)
- Ranked #1,750 of 2,153 Testing & QA skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
test-database-feature capabilities & compatibility
- Capabilities
- integration testing · database testing · test scaffolding
- Works with
- mysql
- Use cases
- testing · database
What test-database-feature says it does
Repository tests MUST connect to actual database (not mocks).
Database: `localhost:3306`, DB: `rapid_db`, User: `rapid_user`, Password: `rapid_password`
npx skills add https://github.com/aws-samples/review-and-assessment-powered-by-intelligent-documentation --skill test-database-featureAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 84 |
| Last updated | August 4, 2026 |
| Repository | aws-samples/review-and-assessment-powered-by-intelligent-documentation ↗ |
What it does
Run RAPID backend repository integration tests against a local MySQL database via Docker and Prisma.
Who is it for?
Verifying repository methods and Prisma schema changes with real-database integration tests.
Skip if: Mock-only unit testing of use cases or handlers, which this skill deliberately avoids for repositories.
When should I use this skill?
After implementing new repository methods, modifying Prisma schema, or testing database-dependent use cases.
By the numbers
- Local database runs on localhost:3306
- Three test file types per feature (integration, usecase, handlers)
Files
Test Database Feature
Prerequisites
1. Start Local Database
docker-compose -f assets/local/docker-compose.yml up -dDatabase: localhost:3306, DB: rapid_db, User: rapid_user, Password: rapid_password
2. Setup Prisma
cd backend
npm run prisma:generate
npm run prisma:migrateRepository Integration Test Pattern
Repository tests MUST connect to actual database (not mocks).
import { describe, it, expect, beforeEach, afterAll } from 'vitest';
import { PrismaClient } from '@prisma/client';
import { makeYourRepository } from '../domain/repository';
const prisma = new PrismaClient();
describe('YourRepository Integration Tests', () => {
beforeEach(async () => {
await prisma.yourModel.deleteMany();
});
afterAll(async () => {
await prisma.$disconnect();
});
it('should create and retrieve entity', async () => {
const repo = makeYourRepository(prisma);
const entity = { id: 'test-1', name: 'Test Entity' };
await repo.storeEntity({ entity });
const retrieved = await repo.findEntityById('test-1');
expect(retrieved).not.toBeNull();
expect(retrieved?.name).toBe('Test Entity');
});
});Test Organization
backend/src/api/features/{feature}/__tests__/
├── repository-integration.test.ts # Database integration tests
├── usecase.test.ts # Use case unit tests (mocked repo)
└── handlers.test.ts # Handler unit tests (mocked usecase)Running Tests
cd backend
npm test # All tests
npm run test -- {test-name} # Specific test suite
npm run test:watch # Watch mode
npm run test:coverage # With coverageQuick Commands
| Task | Command |
|---|---|
| Start DB | docker-compose -f assets/local/docker-compose.yml up -d |
| Stop DB | docker-compose -f assets/local/docker-compose.yml down |
| Reset DB | Add -v to down, then up + migrate |
| Run migrations | cd backend && npm run prisma:migrate |
| Prisma Studio | cd backend && npm run prisma:studio (http://localhost:5555) |
Success Criteria
- Docker container running
- Migrations applied
- All repository integration tests pass
- Ready to run
/build-and-formatfor final verification