log_test: Logging unit test

Description Usage Arguments See Also Examples

View source: R/log_test.R

Description

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.

Usage

1
log_test(..., type = "TEST", params = NULL)

Arguments

...

An unit test function call that is evaluated and logged.

type

A character string. A type of the event. Default for log_test is "TEST".

params

A list of additional named event-specific parameters. Default is NULL.

See Also

Other logging events functions: log_event, log_message, log_output, log_started, log_value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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))
    }
  )
}

shinyEventLogger documentation built on May 1, 2019, 9:26 p.m.