testing-r-packages

Community

Master modern R package testing with testthat 3.

AuthorJDenn0514
Version1.0.0
Installs0

System Documentation

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.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: testing-r-packages
Download link: https://github.com/JDenn0514/surveycore/archive/main.zip#testing-r-packages

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.