Skip to content

Commit

Permalink
use cat so no prettycode is needed
Browse files Browse the repository at this point in the history
  • Loading branch information
catalamarti committed Aug 23, 2024
1 parent ca92294 commit 9ae4286
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion R/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ uiStatic <- function(data = omopgenerics::emptySummarisedResult(),

if (asText) {
x <- paste0("ui <- ", x) |>
styler::style_text()
styler::style_text() |>
as.character()
} else {
x <- x |>
rlang::parse_expr() |>
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/staticShiny.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# multiplication works

Code
uiStatic(data = result, asText = TRUE)
cat(uiStatic(data = result, asText = TRUE), sep = "\n")
Output
ui <- shinydashboard::dashboardPage(
shinydashboard::dashboardHeader(title = "My study"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-staticShiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ test_that("multiplication works", {
#tdir <- here::here()
expect_no_error(exportStaticApp(data = result, directory = tdir))
expect_true("shiny" %in% list.files(tdir))
expect_snapshot(uiStatic(data = result, asText = TRUE))
expect_snapshot(uiStatic(data = result, asText = TRUE) |> cat(sep = "\n"))
unlink(tdir)
})

0 comments on commit 9ae4286

Please sign in to comment.