
Testing R Packages
This covers modern testthat 3+ patterns for R package testing, written by Garrick Aden-Buie. It's structured around the practical stuff: self-sufficient tests with withr for cleanup, snapshot testing for complex output, fixture patterns, and mocking with local_mocked_bindings. The guidance on test organization (mirroring your R/ structure) and the three scales of running tests (micro/mezzo/macro) is immediately useful. What I like is it pushes you toward better habits, repetition over clever abstractions, tests that work in isolation, and the load_all workflow instead of library calls. If you're writing or improving R package tests, this gives you the modern patterns without the philosophy lectures.
- skills.sh installs
- 749
- GitHub stars
- 562
- last updated
- Aug 21, 2026
Install
$ npx -y skills add posit-dev/skills --skill testing-r-packages --agent claude-codeInstalls into .claude/skills of the current project.
Files
This covers modern testthat 3+ patterns for R package testing, written by Garrick Aden-Buie. It's structured around the practical stuff: self-sufficient tests with withr for cleanup, snapshot testing for complex output, fixture patterns, and mocking with local_mocked_bindings. The guidance on test organization (mirroring your R/ structure) and the three scales of running tests (micro/mezzo/macro) is immediately useful. What I like is it pushes you toward better habits, repetition over clever abstractions, tests that work in isolation, and the load_all workflow instead of library calls. If you're writing or improving R package tests, this gives you the modern patterns without the philosophy lectures.
Browse the repository on GitHubSponsors
Details
- Repository
- github.com/posit-dev/skills
- Categories
- Testing & QA, Documentation, Release Management
- First seen
- Jun 3, 2026
More from posit-dev/skills
All 19- Release Post737
- R Cli App736
- Pr Threads Address721
- Pr Threads Resolve721
- Cli705
- Cran Extrachecks664
- Mirai578
- Lifecycle446
- Quarto Alt Text152
- Quarto Authoring1.5K
- Critical Code Reviewer1.1K
- Brand Yml975
- R Package Development866
- Shiny Bslib861
- Describe Design844
- Shiny Bslib Theming807
- Pr Create782
- Create Release Checklist755