Skip to content

Commit

Permalink
tests: Add a unit test for warn_on_error()
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilzyla committed Feb 20, 2024
1 parent 9e05918 commit 976b8b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/testthat/test-app.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ describe("normalize_server()", {
})
})

describe("warn_on_error()", {
it("catches an error and prints it with an appended message", {
expect_message(
warn_on_error(stop("some_error"), "some_message"),
"some_message: some_error"
)
})
})

describe("with_head_tags()", {
it("attaches a head tag to UI", {
ui <- function(request) shiny::tags$div("test")
Expand Down

0 comments on commit 976b8b9

Please sign in to comment.