Expect Invisible

expect_invisible(current, ..., info = NA_character_)

Arguments

current

[R object or expression] Object or expression to be tested

...

Ignored

info

[character(1L)] Optional user-defined message; must be a single string value

Value

A tinytest object. A tinytest object is a logical with attributes holding information about the test that was run

See also

testthat equivalent: testthat::expect_invisible()

withVisible(), invisible()

Other visiblity expectation predicate: expect_visible()

Examples

f <- function() invisible()
expect_invisible(f()) # Pass
#> ----- PASSED      : <-->
#>  call| expect_invisible(f()) 

g <- function() NULL
expect_invisible(g()) # Fail
#> ----- FAILED[attr]: <-->
#>  call| expect_invisible(g())
#>  diff| Expected invisible result, got a visible object