inst/templates/test-throw.R

testthat::context("Testing {{{package}}}:::throw()")
testthat::test_that("throw the {{{ package }}} exception", {
                        error_message <- "hello, testthat"
                        string <- "hello, testthat"
                        testthat::expect_error({{{package}}}:::throw(string),
                            error_message)
}
)

Try the packager package in your browser

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

packager documentation built on Aug. 16, 2023, 5:08 p.m.