Home Comments Thread
New Thread

Converting testthat Tests to testit | /en/2026/05/testthat-to-testit/

giscus giscus 2026-05-18 13:21:22

Back in 2013, I wrote about testing R packages when I first released testit. Thirteen years later, I still believe that unit testing should be nothing more than “tell me if something unexpected …

https://yihui.org/en/2026/05/testthat-to-testit/

👍 1

1 Comment

eliocamp eliocamp 2026-05-18 13:21:24

I imagine you could put

library(testit)
test_pkg("pkgname")

In a a testthat.R package and then devtools::check() would work fine?

yihui yihui 2026-05-18 15:16:14

Yes, that should work, since devtools::check() is essentially a wrapper of R CMD check (as I said in the post, R CMD check works with any testing framework). I've never used devtools::check(), though (for similar reasons, such as the unbearable weight).

Sign in to join the discussion

Sign in with GitHub