Skip to content

Commit

Permalink
capturing it
Browse files Browse the repository at this point in the history
  • Loading branch information
Melkiades committed Feb 9, 2023
1 parent 46cb2d4 commit 658ad9a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/testthat/test-g_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ adlb$AVISIT <- droplevels(adlb$AVISIT)
adlb <- dplyr::mutate(adlb, AVISIT = forcats::fct_reorder(AVISIT, AVISITN, min))

testthat::test_that("g_lineplot works with default settings", {
g_lineplot(adlb, adsl)
some_warning <- capture_warnings(g_lineplot(adlb, adsl))
if (isTRUE(length(some_warning) > 0)){
stop("THIS IS THE WARNING 1: ", some_warning)
}
})

testthat::test_that("g_lineplot works with custom settings and statistics table", {
g_lineplot(
some_warning <- capture_warnings(g_lineplot(
adlb,
adsl,
strata = control_lineplot_vars(strata = NULL),
Expand All @@ -19,5 +22,8 @@ testthat::test_that("g_lineplot works with custom settings and statistics table"
y_lab = "Lab Test",
subtitle = "Laboratory Test:",
caption = "caption"
)
))
if (isTRUE(length(some_warning) > 0)){
stop("THIS IS THE WARNING 2: ", some_warning)
}
})

0 comments on commit 658ad9a

Please sign in to comment.