This skill provides specialized guidance for writing, organizing, and optimizing R package tests using the latest testthat features. It covers advanced patterns like self-sufficient tests, proper side-effect cleanup with withr, snapshot testing for complex outputs, and Behavior-Driven Development (BDD) using describe and it syntax. By following these patterns, users can ensure their R packages are robust, maintainable, and meet the high standards of the modern R ecosystem defined by Posit and r-lib.
主な機能
01Side-effect management and state cleanup using withr
0210 GitHub stars
03Behavior-Driven Development (BDD) patterns with describe() and it()
04Mocking external dependencies and API calls
05Snapshot testing for complex output and error message verification
06Modern testthat 3rd edition syntax and expectations