13.6 Setup

run usethis::use_testhat(3)

(usually done once per package, can opt into 3e if package already uses testthat)

  1. creates a tests/testhat/ directory
  2. Add testthat to the Suggests field in the DESCRIPTION and specify testthat 3e in the Config/testthat/edition field
  3. Create a file tests/testthat.R that runs all your tests when R CMD check runs DO NOT EDIT