I have a bunch of R code that I need to start re-using across several projects. I do not currently have any sort of integration tests or unit tests established for it. I am used to using unittest
in Python, since its built into the standard library so its easy to just git clone
my repo and run tests out of the box. However I am having trouble finding the same in R. Seems like most of the unit test libraries are 3rd party thus need extra installation and environment management, etc.. Also from reading code samples for each, I am not clear which are the easiest to use.
What kind of experiences have others had with these libraries? I was leaning towards RUnit (https://cran.r-project.org/web/packages/RUnit/vignettes/RUnit.pdf) but would like to hear what has worked/not worked for you all.
and of course, I stumbled upon this page 5 minutes after making this post; https://bioconductor.org/developers/how-to/unitTesting-guidelines/ provides a comparison of RUnit vs testthat
while that article seems a little outdated now, it does appear that
RUnit
has less frequent development thantestthat
;https://cran.r-project.org/web/packages/RUnit/ <- last published 2018
https://cran.r-project.org/web/packages/testthat/index.html <- last published 2021