11
22#  regression test: test_file() used to crash with a NULL reporter
33test_that(" ListReporter with test_file and NULL reporter"  , {
4+   withr :: local_envvar(TESTTHAT_GHA_SUMMARY  =  " FALSE"  )
45  test_file_path  <-  ' test-list-reporter/test-exercise-list-reporter.R' 
56  expect_error(test_file(test_path(test_file_path ), reporter  =  NULL ), NA )
67})
@@ -9,6 +10,7 @@ test_that("ListReporter with test_file and NULL reporter", {
910#  of a test (test_that() call).
1011#  N.B: the exception here happens between two tests: "before" and "after"
1112test_that(" ListReporter - exception outside of test_that()"  , {
13+   withr :: local_envvar(TESTTHAT_GHA_SUMMARY  =  " FALSE"  )
1214  test_file_path  <-  ' test-list-reporter/test-exception-outside-tests.R' 
1315  res  <-  test_file(test_path(test_file_path ), reporter  =  NULL )
1416
@@ -31,6 +33,7 @@ test_that("ListReporter - exception outside of test_that()", {
3133
3234
3335test_that(" captures error if only thing in file"  , {
36+   withr :: local_envvar(TESTTHAT_GHA_SUMMARY  =  " FALSE"  )
3437  test_file_path  <-  ' test-list-reporter/test-only-error.R' 
3538  res  <-  test_file(test_path(test_file_path ), reporter  =  NULL )
3639
@@ -40,6 +43,7 @@ test_that("captures error if only thing in file", {
4043
4144#  ListReporter on a "standard" test file: 2 contexts, passing, failing and crashing tests
4245test_that(" exercise ListReporter"  , {
46+   withr :: local_envvar(TESTTHAT_GHA_SUMMARY  =  " FALSE"  )
4347  test_file_path  <-  ' test-list-reporter/test-exercise-list-reporter.R' 
4448  res  <-  test_file(test_path(test_file_path ), reporter  =  NULL )
4549  expect_s3_class(res , " testthat_results"  )
@@ -60,6 +64,7 @@ test_that("exercise ListReporter", {
6064
6165#  bare expectations are ignored
6266test_that(" ListReporter and bare expectations"  , {
67+   withr :: local_envvar(TESTTHAT_GHA_SUMMARY  =  " FALSE"  )
6368  test_file_path  <-  ' test-list-reporter/test-bare-expectations.R' 
6469  res  <-  test_file(test_path(test_file_path ), reporter  =  NULL )
6570
0 commit comments