test_that("API is up", {
.alive <- function() {
tryCatch(
check_api_status(),
error = function(e) "not ok"
)
}
.difftime <- function(starttime, currtime = Sys.time()) {
as.numeric(currtime - starttime)
}
status <- ""
starttime <- Sys.time()
tries <- 0
while(status != "ok" & (.difftime(starttime) < 180)) {
if (tries > 0) Sys.sleep(10)
status <- .alive()
tries <- tries + 1
}
expect_equal(
status,
"ok"
)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.