Skip to content

Commit c253b45

Browse files
hook tests are now scattered over all files
1 parent fdd4f3a commit c253b45

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/hook-tests.yaml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,15 @@ jobs:
9797
- name: Test
9898
run: |
9999
pkgload::load_all()
100-
testthat::test_file(
101-
"tests/testthat/test-hooks.R",
102-
reporter = testthat::MultiReporter$new(list(
103-
testthat::CheckReporter$new(), testthat::FailReporter$new()
104-
))
105-
)
100+
hook_test_files <- as.character(fs::dir_ls('tests/testthat/', regexp = "test-hook-.*\\.R", type = "file"))
101+
tester <- function(file) {
102+
testthat::test_file(file,
103+
reporter = testthat::MultiReporter$new(list(
104+
testthat::CheckReporter$new(), testthat::FailReporter$new()
105+
))
106+
)
107+
}
108+
purrr::walk(hook_test_files, tester)
106109
shell: Rscript {0}
107110
- name: Show testthat output
108111
if: always()

0 commit comments

Comments
 (0)