This extension is built to help you run R tests on VSCode. Currently only testthat and tinytest frameworks are supported. You can run and debug individual tests.
This extension expects Rscript to be in the path, or pointed with the RTestAdapter.RscriptPath setting, and requires devtools>=2.3.2 to be installed for the environment Rscript is connected to.
Additionally, in order to debug tests, you will need to install:
- the R Debugger extension
- the vscDebugger package in R
The following parameters are supported .vscode/settings.json.
The following option is used in the devtools::load_all call
in the R code entry point. Empty value means the current workspace folder
in VSCode.
{
"RTestAdapter.RPackageRoot": "" // default
}The following two options define where to look for tests relative to the current workspace folder. After modifying those entries, please use the 'Rediscover tests' button in the top of the Testing Tab.
{
"RTestAdapter.testthatSearchPath": "**/tests/testthat/**/test*.R", // default
"RTestAdapter.tinytestSearchPath": "**/inst/tinytest/**/test*.R" // default
}