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



aryoda/tryCatchLog documentation built on Feb. 6, 2023, 1:42 a.m.