What problem does it solve?
Writing robust R package tests can be tedious and inconsistent; this skill consolidates best practices for testthat 3+ to help developers create reliable, repeatable tests with structured layouts, fixtures, and mocking patterns.
Core Features & Use Cases
- Standardized test structure aligned with testthat 3 edition, enabling clear separation between unit, integration, and snapshot tests.
- Fixture and helper management including reusable data builders and static fixtures for reproducible results.
- Mocking strategies with local_mocked_bindings and related utilities to isolate external dependencies in tests.
- Snapshot testing guidance to validate complex outputs, messages, and warnings across changes.
- Practical guidance for R package development workflows, CRAN checks, and continuous integration.
Quick Start
Install testthat 3 and initialize a testing directory with usethis, then begin creating tests under tests/testthat following the patterns described.