r-testing
Installation
SKILL.md
R Testing
When to Activate
- Writing tests with testthat in R packages
- Mocking HTTP calls or functions in tests
- Setting up coverage reporting with covr
- Testing Shiny applications with shinytest2
- Choosing between
expect_equalandexpect_identicalfor numeric vs. exact comparison - Using snapshot testing to lock in the printed output of S3 objects or complex data structures
- Enforcing a minimum coverage percentage in CI with
covr::percent_coverage - Running property-based tests with
hedgehogto verify algebraic laws like commutativity or idempotence