Skip to content

Commit bb437a4

Browse files
author
Daniel D. Sjoberg
committed
only run tests when pkgs are available
1 parent 3d6b4a0 commit bb437a4

File tree

5 files changed

+7
-5
lines changed

5 files changed

+7
-5
lines changed

R/add_vif.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#' @seealso Review [list, formula, and selector syntax][syntax] used throughout gtsummary
1212
#' @export
1313
#'
14-
#' @examplesIf (identical(Sys.getenv("NOT_CRAN"), "true") || identical(Sys.getenv("IN_PKGDOWN"), "true")) && gtsummary:::is_pkg_installed(c("cardx", "car"))
14+
#' @examplesIf (identical(Sys.getenv("NOT_CRAN"), "true") || identical(Sys.getenv("IN_PKGDOWN"), "true")) && gtsummary:::is_pkg_installed(c("cardx", "car", "broom.helpers"))
1515
#' # Example 1 ----------------------------------
1616
#' lm(age ~ grade + marker, trial) |>
1717
#' tbl_regression() |>

man/add_vif.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-gather_ard.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
skip_on_cran()
2-
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers", "car")))
2+
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers", "car", "parameters")))
33

44
test_that("gather_ard(x) works with `tbl_*()` functions", {
55
# tbl_summary()

tests/testthat/test-modify_caption.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test_that("modify_caption() works with tbl_cross()", {
4949
})
5050

5151
test_that("modify_caption() works with tbl_regression()", {
52-
skip_if_not(is_pkg_installed("broom.helpers"))
52+
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers")))
5353

5454
expect_equal(glm(response ~ age + grade, trial, family = binomial()) |>
5555
tbl_regression(exponentiate = TRUE) |>
@@ -62,6 +62,7 @@ test_that("modify_caption() works with tbl_regression()", {
6262
})
6363

6464
test_that("modify_caption() works with tbl_uvregression()", {
65+
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers")))
6566
expect_equal(tbl_uvregression(trial, method = glm, y = response, method.args = list(family = binomial),
6667
exponentiate = TRUE, include = c("age", "grade")) |>
6768
modify_caption("**Adding a caption**", text_interpret = "html") |>

tests/testthat/test-modify_spanning_header.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ test_that("modify_spanning_header() works with tbl_cross()", {
160160
})
161161

162162
test_that("modify_spanning_header() works with tbl_regression()", {
163-
skip_if_not(is_pkg_installed("broom.helpers"))
163+
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers")))
164164

165165
expect_equal(
166166
glm(response ~ age + grade, trial, family = binomial()) |>
@@ -174,6 +174,7 @@ test_that("modify_spanning_header() works with tbl_regression()", {
174174
})
175175

176176
test_that("modify_spanning_header() works with tbl_uvregression()", {
177+
skip_if_not(is_pkg_installed(c("cardx", "broom.helpers")))
177178
expect_equal(
178179
tbl_uvregression(trial, method = glm, y = response, method.args = list(family = binomial),
179180
exponentiate = TRUE, include = c("age", "grade")) |>

0 commit comments

Comments
 (0)