/* voltgrid */ → tests
VoltGrid Test Suite
This is the case study's test suite running: unit tests for the tariff logic, feature tests against the API (including the 422 cases from the sandbox API), with a coverage report and quality gate at the end. The run below plays automatically, ↻ replays it.
unit
Tariff math and connector matching are pure domain logic, tested without a database, which is why they finish in milliseconds.
feature
The feature tests hit exactly the endpoints of the sandbox API, including the error cases: maintenance, occupied, invalid kWh.
gate
Below 90 % coverage the CI aborts. The gate is part of the pipeline, not up for negotiation.
// Demonstrative run with realistic output · the same test culture (Pest/Vitest, gates) runs in real projects like schnappern.com.