The package uses the testthat
framework for
unit testing and as a test runner. Any contribution to the code of the package
must include tests that conform to the style of existing testing.
Complete and high test coverage is a priority and goal in the package to ensure
a stable and reliable user experience. We use covr
for computing and tracking test coverage. covr
results are uploaded to codecov
and
automatic through github actions, see https://github.com/openaq/openaq-r/blob/main/.github/workflows/test-coverage.yaml.
YML test fixures are generated using vcr
and based off a local deployment of the
OpenAQ database and
OpenAQ API instead of the live hosted
instance. This is to provide a reproduceable and predictable test cases.
JSON test fixtures are generated by JSON schema faker based on JSON schemas derived from the OpenAQ API Pydantic models.