Skip to content

Checks that the code produces no output, messages, or warnings.

Usage

expect_silent(object)

Arguments

object

Object to test.

Supports limited unquoting to make it easier to generate readable failures within a function or for loop. See quasi_label for more details.

Value

The first argument, invisibly.

Examples

expect_silent("123")

f <- function() {
  message("Hi!")
  warning("Hey!!")
  print("OY!!!")
}
if (FALSE) { # \dontrun{
expect_silent(f())
} # }