library(gendatypes)
library(testthat)
test_that("throw_exception stops execution", {
result <- list()
expect_error(throw_exception(result), regexp = "Argument `result` is incorrect!")
})
test_that("throw_exception displays custom message", {
result <- list()
expect_error(expect_message(throw_exception(result, message = "Custom error!")))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.