Skip to content
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# testthat (development version)

* Fixed support for `shinytest2::AppDriver$expect_values()` screenshot snapshot failing on CI (#2293, #2288).

# testthat 3.3.0

## Lifecycle changes
Expand Down
5 changes: 4 additions & 1 deletion R/expectation.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ exp_signal <- function(exp) {
} else {
signalCondition(exp)
},
muffle_expectation = function(e) NULL
muffle_expectation = function(e) NULL,
# Legacy support for shinytest2
# https://github.com/r-lib/testthat/pull/2271#discussion_r2528722708
continue_test = function(e) NULL
)

invisible(exp)
Expand Down
6 changes: 4 additions & 2 deletions R/snapshot-file.R
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,11 @@ snapshot_file_equal <- function(
# We want to fail on CI since this suggests that the user has failed
# to record the value locally
if (fail_on_new) {
return(snapshot_fail(message, trace_env = trace_env))
snapshot_fail(message, trace_env = trace_env)
} else {
testthat_warn(message)
}
testthat_warn(message)

TRUE
}
}
Expand Down
2 changes: 1 addition & 1 deletion R/test-that.R
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test_code <- function(code, env, reporter = NULL, skip_on_empty = TRUE) {
}
handle_expectation <- function(e) {
the$test_expectations <- the$test_expectations + 1L
register_expectation(e, 7)
register_expectation(e, 11)
invokeRestart("muffle_expectation")
}
handle_warning <- function(e) {
Expand Down