Skip to content

Commit

Permalink
Simplify/robustify reactlog version checking test
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheng5 committed Dec 5, 2024
1 parent 8f5fb1d commit af4e23a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions tests/testthat/test-reactlog.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,9 @@ test_that("message logger appears", {


test_that("reactlog_version is as expected", {
suggests <- strsplit(packageDescription("shiny")$Suggests, ",")[[1]]
reactlog <- trimws(
grep("reactlog", suggests, value = TRUE)
)
expect_length(reactlog, 1)
expect_equal(
reactlog,
sprintf("reactlog (>= %s)", reactlog_min_version)
expect_match(
packageDescription("shiny")$Suggests,
# The space between reactlog and the version number can include \n
sprintf("\\breactlog\\s+\\Q(>= %s)\\E", reactlog_min_version)
)
})

0 comments on commit af4e23a

Please sign in to comment.