test_that("expect_deprecated() expects lifecycle warnings", {
fn <- function() deprecate_warn("1.0", "pkg::foo()", id = "expect-deprecated")
expect_success(expect_deprecated(fn()))
expect_success(expect_deprecated(fn()))
expect_failure(expect_deprecated(NULL))
})
test_that("expect_defunct() expects lifecycle errors", {
fn <- function() deprecate_stop("1.0", "pkg::foo()")
expect_success(expect_defunct(fn()))
expect_failure(expect_defunct(NULL))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.