log_test
logs a unit test
which can be built in inside a shiny app.
The event logged has status SUCCESS
or ERROR
if the unit test does not pass successfully.
The error status is logged silently and does not stops
the shiny app from running by itself.
The error message is logged in a log entry body.
Deparsed unit test function call is logged
as an event name in a log entry header.
log_test(..., type = "TEST", params = NULL)
... | An unit test function call that is evaluated and logged. |
---|---|
type | A character string. A type of the event.
Default for |
params | A list of additional named event-specific parameters.
Default is |
Other logging events functions: log_event
,
log_message
, log_output
,
log_started
, log_value
if (interactive()) { set_logging() shiny::shinyApp( ui = shiny::fluidPage(log_init()), server = function(input, output) { set_logging_session() log_test(testthat::expect_true(TRUE)) log_test(testthat::expect_true(FALSE)) } ) }