test_dir
Runs all test files in a directory with testthat, optionally filtered, and returns pass/fail/skip counts.
Instructions
Run all test files in a directory (optionally filtered) using testthat::test_dir(). Returns a summary of pass/fail/skip counts.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "test_dir"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path to the directory containing test files. | |
| filter | No | Regex pattern to restrict which test files are run (e.g. 'my_func'). | |
| reporter | No | testthat reporter to use (e.g. 'progress', 'summary', 'tap'). Defaults to 'progress'. | |
| stop_on_failure | No | Whether to stop immediately on the first test failure (default false). |