Commercial enterprise offerings Open source packages - Quarto, Shiny, and more

testthat 0.8 (and 0.8.1)

Hadley Wickham Headshot
Written by Hadley Wickham
2014-02-25

We’re pleased to announce a new major version of testthat. Version 0.8 comes with a new recommended structure for storing your tests. To better meet CRAN recommended practices, we now recommend that tests live in tests/testthat, instead of inst/tests. This makes it possible for users to choose whether or not to install tests. With this new structure, you’ll need to use test_check() instead of test_packages() in the test file (usually tests/testthat.R) that runs all testthat unit tests.

Another big improvement comes from Karl Forner. He contributed code which provides line numbers in test errors so you can see exactly where the problems are. There are also four new expectations (expect_null(), expected_named(), expect_more_than(), expect_less_than()) and many other minor improvements and bug fixes. For a complete list of changes, please see the github release. After release of 0.8 to CRAN, we discovered two small bugs. These were fixed in 0.8.1.

As always, you can install the latest version with install.packages("testthat").

Hadley Wickham Headshot

Hadley Wickham

Chief Scientist, Posit
Hadley is Chief Scientist at Posit PBC, winner of the 2019 COPSS award, and a member of the R Foundation. He builds tools (both computational and cognitive) to make data science easier, faster, and more fun. His work includes packages for data science (like the tidyverse, which includes ggplot2, dplyr, and tidyr)and principled software development (e.g. roxygen2, testthat, and pkgdown). He is also a writer, educator, and speaker promoting the use of R for data science.