# R package tests

> Writes testthat tests for R packages with fixtures, mocking and snapshots that clean up after themselves.

- Page: https://youraiskill.com/skill/posit-dev-r-testthat
- What it does: Best practices for writing R package tests with testthat version 3+. Use this skill when writing or organizing tests for an R package or when improving existing tests that use testthat. It covers test structure and expectations, self-sufficient test design, proper cleanup with withr, fixtures, mocking external dependencies, snapshot testing, and BDD-style describe/it patterns.
- Niches: testing, data
- Licence: MIT
- Status: Checked: open licence, author credited, passed the YourAISkill safety scan. Can be added to a paid pack.
- Contents: instructions and reference files only (6 files)

To add it, see https://youraiskill.com/guides/how-to-add-a-skill-to-claude
