- Build:
npm run build(TypeScript compilation with clean) - Type Check:
npm run typecheck(no emit, type checking only) - Test:
npm test(runs borp test runner on all packages) - Single Test:
cd packages/<package> && npm test <file>.spec.ts
- Monorepo with workspaces in
packages/(core, engine-mongodb, engine-rabbitmq, engine-redis, fastify) - TypeScript with composite project references
- Each package has its own
package.jsonandtsconfig.json
- TypeScript: Strict mode enabled, ES2023 target, CommonJS modules
- Imports: Use named imports, organize by external/internal
- Types: Explicit typing, use interfaces for objects, type aliases for unions
- Naming: camelCase for variables/functions, PascalCase for types/classes
- Files: kebab-case for files,
.spec.tsfor tests - Error Handling: Use Result types or explicit error handling patterns
- Testing: Use borp test runner, descriptive test names
- Plugin-based architecture with dependency injection
- Workflow state management with storage abstraction
- Type-safe step definitions with context passing
- Use Given/When/Then structure for clear test organization and readability
- Test naming: Use
should be able to [capability]format (e.g., "should be able to produce in the queue after connection was lost")
- Always use toxiproxy for simulating network outages/connection issues
- Never stop/start containers for connection simulation as it prevents test parallelization
- Create individual proxies for each test case to ensure proper isolation
- Use toxics (bandwidth limitation, latency injection, etc.) for realistic network failure simulation
- Ensure parallelizability - tests must be able to run concurrently
- Proper cleanup - always clean up proxies and toxics in test teardown
- Extended timeouts - account for container startup and network simulation delays
- Faster test execution (no container restarts)
- Better CI/CD performance through parallel execution
- More realistic network failure scenarios
- Better test isolation and reliability
These rules will be applied to all future resilience and network failure testing scenarios.