tests/testthat/test-cli.R

test_that("cli_status", {
  withr::local_options(cli.ansi = FALSE)
  expect_snapshot({
    pid <- cli_status("This is a status message")
    cli::cli_status_clear(pid, result = "clear")
  })

  expect_snapshot({
    pid <- cli_status("This is a status message")
    cli::cli_status_clear(pid, result = "failed")
  })
})

Try the rhub package in your browser

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

rhub documentation built on April 3, 2025, 10:47 p.m.