test_file
Runs a single testthat test file to enable targeted debugging and rapid iteration during R package development.
Instructions
Run a single testthat test file using testthat::test_file(). Useful for rapid iteration on a specific file.
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": {
"file": "<file>"
},
"name": "test_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | Yes | Absolute path to the test file to run (e.g. '/path/to/tests/testthat/test-utils.R'). | |
| reporter | No | testthat reporter to use (e.g. 'progress', 'summary', 'tap'). Defaults to 'progress'. | |
| project_path | No | Optional absolute path to the package root (used to set the working directory). | |
| stop_on_failure | No | Whether to stop immediately on the first test failure (default false). |