Use the following steps to build a unit test suite to ensure that functions work as you intend:
- Create the test folder structure:
usethis::use_testthat()
- Add a new test:
usethis::use_test("adds")
test_that("addition works", {
expect_equal(1 + 1, 2)
})
- Run the actual tests:
devtools::test()