inst/templates/junit-testthat.R

library(testthat)
library({{{ name }}})

if (requireNamespace("xml2")) {
  test_check("{{{ name }}}", reporter = MultiReporter$new(reporters = list(JunitReporter$new(file = "test-results.xml"), CheckReporter$new())))
} else {
  test_check("{{{ name }}}")
}

Try the usethis package in your browser

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

usethis documentation built on July 9, 2023, 7:23 p.m.