tests/testthat/test-warning.R

funcao_pai <- function() warning_teste()

warning_teste <- function() {
  warning_endbr(c("teste", "*" = "informacao"), call = rlang::caller_env())
}

test_that("warning funciona corretamente", {
  expect_warning(funcao_pai(), class = "warning_endbr_teste")
  expect_warning(funcao_pai(), class = "warning_endbr")

  expect_snapshot(funcao_pai(), cnd_class = TRUE)
})

Try the enderecobr package in your browser

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

enderecobr documentation built on April 3, 2025, 8:40 p.m.