Skip to content

Commit 3d9ecd4

Browse files
committed
Fix failure fall through
1 parent b90afd7 commit 3d9ecd4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

R/snapshot-reporter.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ SnapshotReporter <- R6::R6Class(
9292
value_enc
9393
)
9494
if (fail_on_new) {
95-
return(fail(message, trace_env = trace_env))
95+
fail(message, trace_env = trace_env)
96+
return(NULL)
9697
} else {
9798
testthat_warn(message)
9899
}

R/snapshot.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ expect_snapshot_helper <- function(
331331
variant = variant,
332332
trace_env = trace_env
333333
)
334+
# Comparison failed
335+
if (is.null(comp)) {
336+
return(invisible())
337+
}
334338

335339
if (!identical(variant, "_default")) {
336340
variant_lab <- paste0(" (variant '", variant, "')")

0 commit comments

Comments
 (0)