test_that("toConditional() works", {
f <- kwb.utils:::toConditional
expect_error(f())
result <- f(function(x) print("hello"))
expect_is(result, "function")
expect_output(result(NULL, TRUE))
expect_silent(result(NULL, FALSE))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.