Skip to content

Commit

Permalink
Fixes turning on/off stream output when option is on
Browse files Browse the repository at this point in the history
  • Loading branch information
edgararuiz committed Apr 3, 2024
1 parent 2f4c14b commit 3aa82f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/chattr-test.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ ch_submit.ch_test_backend <- function(
preview = FALSE,
...) {
is_test <- unlist(options("chattr-shiny-test")) %||% FALSE
if (stream) {
if (stream && !is_test) {
for (i in seq_len(nchar(prompt))) {
if(is_test) cat(substr(prompt, i, i))
cat(substr(prompt, i, i))
Sys.sleep(0.1)
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-chattr.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
test_that("chattr() works", {
options("chattr-shiny-test" = FALSE)
local_mocked_bindings(
ui_current = function(...) {
""
Expand Down

0 comments on commit 3aa82f7

Please sign in to comment.