Development & Testing
How to maintain and test the Conduit implementation.
Developing on the Conduit app is designed to be fast. This guide covers the essential workflows for building and verifying the application.
Development Workflow
Watch Mode
Run bun run --cwd apps/conduit dev to start the app with auto-reloading.
Linting & Formatting
We use Biome. Run bun run fix from the root to automatically fix issues.
Database Changes
If you modify a *.schema.ts file:
- Run
bun run --cwd apps/conduit db:generateto create a migration. - Run
bun run --cwd apps/conduit db:pushto apply it.
Testing Strategy
Bedstack uses Bun's built-in test runner. There are two types of tests in this codebase:
1. Unit Tests
Located next to the source files (e.g., users.service.test.ts). These focus on testing business logic in isolation.
# Run all unit tests
bun run --cwd apps/conduit test:unit2. API Compliance Tests
These are the rigorous RealWorld API tests. They ensure the app is 100% compliant with the specification.
To run these:
- Make sure the app is running in dev mode.
- Run the following command:
bun run --cwd apps/conduit test:apiExploring with Swagger
Thanks to Elysia's integration, you can explore the entire API without writing a single line of client code. Open http://localhost:3000/swagger to:
- View all endpoints and their expected request bodies.
- Execute real requests against your local database.
- See real-time validation errors if your request is malformed.
Deployment
To build a production bundle of the Conduit app:
bun run --cwd apps/conduit buildThe resulting binary will be optimized and ready for deployment in any cloud environment.