@layer-drone/protocol
v0.6.0
Published
Layer Drone protocol SDK with typed API client and event parsing
Keywords
Readme
Protocol SDK Test Setup
This directory contains comprehensive tests for the Layer Drone Protocol SDK that validate SDK functionality using mocks and simulated API responses.
Test Configuration
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.
Running Tests
Standard Test Run
# Run all tests with mocks
pnpm testWith Coverage
# Run tests with coverage reporting
pnpm test:coverageTest Coverage
The test suite includes:
- Client Creation and Configuration - SDK initialization and configuration
- API Integration Tests - Tests using mocked API responses:
- Health check endpoint (
/) - Sun altitude calculations (
/conditions/sun-altitude) - Event schema retrieval (
/schema/event)
- Health check endpoint (
- Error Handling - Network errors, 404s, invalid parameters
- Response Styles - Data-only vs full response formats
- Event Parsing - Webhook event validation and parsing
- Integration Tests - Complete workflows using mocks:
- Flight workflow (storage key generation, presigned URLs, validation)
- API token management (CRUD operations)
- Mission creation workflow
- Type Safety - TypeScript type validation and BigInt handling
SonarQube Integration
Test coverage is automatically included in SonarQube scans via the LCOV report at ./coverage/lcov.info.
