Skip to content

Commit 1b5d172

Browse files
committed
Add a way to hide echo in render
while triggering some non quarto quiet tests
1 parent e929d5a commit 1b5d172

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

R/quarto.R

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ quarto_run <- function(
159159
custom_env <- c("current", custom_env)
160160
}
161161

162+
# Special case for tests to force hiding echo
163+
if (is_testing() && getOption("quarto.tests.hide_echo", FALSE)) {
164+
echo <- FALSE
165+
}
166+
162167
res <- withCallingHandlers(
163168
processx::run(
164169
quarto_bin,

R/utils.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,7 @@ is_empty_dir <- function(dir) {
213213
files <- list.files(dir, all.files = TRUE, no.. = TRUE)
214214
length(files) == 0
215215
}
216+
217+
is_testing <- function() {
218+
identical(Sys.getenv("TESTTHAT"), "true")
219+
}

0 commit comments

Comments
 (0)