tests/testthat/test-browser.R

test_that("browser() usages are errors in tests", {
  skip_if(getRversion() < "4.3.0")
  if (!interactive())
    expect_error(browser())
})

Try the testthat package in your browser

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

testthat documentation built on Oct. 6, 2023, 5:10 p.m.