Run testthat tests against a patched package namespace

test_patched_dir(pkg, test_path = "tests/testthat", reporter = "summary")

Arguments

pkg

Package name that has been patched in memory.

test_path

Path to tests to run.

reporter

testthat reporter name or object.

Value

Result object from testthat::test_dir.

Examples

if (FALSE) { # \dontrun{
  # Inject a patch to the package
  inject_patch(
    pkg = "hotpatchR",
    patch_list = list(dummy_child_func = function(x) {
      paste("PATCHED! Input:", x)
    })
  )

  # Run tests against the patched package
  test_patched_dir(pkg = "hotpatchR")
} # }