13.6 Setup
run usethis::use_testhat(3)
(usually done once per package, can opt into 3e if package already uses testthat
)
- creates a tests/testhat/ directory
- Add
testthat
to the Suggests field in the DESCRIPTION and specifytestthat
3e in the Config/testthat/edition field - Create a file tests/testthat.R that runs all your tests when R CMD check runs DO NOT EDIT