test_that("if error works", {
attempt <- tryCatch(stop('ahh'), error = function(e) e)
expect_null(pkgpub:::if_error(attempt))
expect_equal(pkgpub:::if_error(attempt, "recovered"), "recovered")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.