Skip to content

Commit f590107

Browse files
committed
Forward errors encountered while collecting mock cases
1 parent f253232 commit f590107

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/testthat/helper-mock.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ if (!old_freetype() && !on_load) {
4343

4444
test_results <- testthat::test_dir(mock_test_dir, reporter = "silent")
4545
mock_cases_outputs <- purrr::quietly(purrr::safely(collect_cases))(mock_pkg_dir)
46-
mock_cases <- mock_cases_outputs$result$result
4746

47+
quietly_out <- mock_cases_outputs$result
48+
if (inherits(quietly_out$error, "condition")) {
49+
cat("While collecting testing cases:\n")
50+
stop(quietly_out$error)
51+
}
52+
53+
mock_cases <- quietly_out$result
4854
validate_cases(mock_cases)
4955
}

0 commit comments

Comments
 (0)