testing-r-packages
FeaturedBest practices for writing R package tests using testthat version 3+. Use when writing, organizing, or improving tests for R packages. Covers test structure, expectations, fixtures, snapshots, mocking, and modern testthat 3 patterns including self-sufficient tests, proper cleanup with withr, and snapshot testing.
Install
Quality Score: 92/100
Skill Content
Details
- Author
- posit-dev
- Repository
- posit-dev/skills
- Created
- 9 months ago
- Last Updated
- 3 days ago
- Language
- R
- License
- MIT
Similar Skills
Semantically similar based on skill content — not just same category
r-package-development
R package development with devtools, testthat, and roxygen2. Use when the user is working on an R package, running tests, writing documentation, or building package infrastructure.
testing
This skill should be used when the user asks to "write tests", "fix failing tests", "improve test coverage", "add integration tests", "debug a flaky test", or reviews test quality. Provides behavior-focused testing patterns, coverage analysis, and detection of brittle test anti-patterns like implementation coupling and non-deterministic assertions.
testing
Comprehensive testing patterns and anti-patterns for writing and reviewing tests