How to do it...

Use the following steps to build a unit test suite to ensure that functions work as you intend:

  1. Create the test folder structure:
usethis::use_testthat()
  1. Add a new test:
usethis::use_test("adds")

test_that("addition works", {
expect_equal(1 + 1, 2)
})
  1. Run the actual tests:
devtools::test()
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.9.12