tests/testthat/readme_testing.md

Some testing hints

To skip a test on CRAN:

test_that("Test does not run on CRAN", {
  testthat::skip_on_cran()
  ...

To skip a test based on a precondition

test_that("does only work fridays", {
  if (is.friday(today())) skip("Not today.")

How to separate testthat unit tests for manual-only execution

If you put your manual test files into another directory within the tests folder, you can still test them manually with test_dir(), but they won't be running with test() or R CMD check.

Source: https://stackoverflow.com/questions/25595487/testthat-pattern-for-long-running-tests



Try the tryCatchLog package in your browser

Any scripts or data that you put into this service are public.

tryCatchLog documentation built on Oct. 25, 2021, 9:08 a.m.