We have a package with a function.
use_testthat()
.
use_test("time")
: first a simple test, then a snapshot test, then a snapshot of the error.
devtools::test()
/ test the file on its own via the button.
π testthat website
Use withr::local_options()
in a test.
Look at the docs of testthat::test_path()
.
Create a helper function in a file tests/testthat/helper-bla.R
, use it in a test.
π withr website
π Helper code and files for your testthat tests
π§° repeat the steps!
usethis::use_github_action_check_standard()
. Check on the cloud, different operating systems.π usethis support for GitHub Actions setup
π§° Repeat the steps!