Layer Drone protocol SDK with typed API client and event parsing
npm install @layer-drone/protocolThis directory contains comprehensive tests for the Layer Drone Protocol SDK that validate SDK functionality using mocks and simulated API responses.
The tests are designed to be completely self-contained and run seamlessly in CI/CD environments without any external dependencies. All API interactions are mocked to ensure reliable, fast test execution.
bash
Run all tests with mocks
pnpm test
`$3
`bash
Run tests with coverage reporting
pnpm test:coverage
`Test Coverage
The test suite includes:
1. Client Creation and Configuration - SDK initialization and configuration
2. API Integration Tests - Tests using mocked API responses:
- Health check endpoint (
/)
- Sun altitude calculations (/conditions/sun-altitude)
- Event schema retrieval (/schema/event)
3. Error Handling - Network errors, 404s, invalid parameters
4. Response Styles - Data-only vs full response formats
5. Event Parsing - Webhook event validation and parsing
6. Integration Tests - Complete workflows using mocks:
- Flight workflow (storage key generation, presigned URLs, validation)
- API token management (CRUD operations)
- Mission creation workflow
7. Type Safety - TypeScript type validation and BigInt handlingSonarQube Integration
Test coverage is automatically included in SonarQube scans via the LCOV report at
./coverage/lcov.info`.