tests/testthat/test-add_stat_label.R

context("test-add_stat_label")

test_that("no errors/warnings with standard use", {
  expect_error(mtcars %>% fmt_table1(by = "am") %>% add_stat_label(iqr = TRUE), NA)
  expect_warning(mtcars %>% fmt_table1(by = "am") %>% add_stat_label(iqr = TRUE), NA)

  expect_error(mtcars %>% fmt_table1(by = "am") %>% add_stat_label(iqr = FALSE) %>% add_comparison(), NA)
  expect_warning(mtcars %>% fmt_table1(by = "am") %>% add_stat_label(iqr = FALSE) %>% add_comparison(), NA)

  expect_error(mtcars %>% fmt_table1(by = "am") %>% add_overall() %>% add_stat_label(iqr = TRUE), NA)
  expect_warning(mtcars %>% fmt_table1(by = "am") %>% add_overall() %>% add_stat_label(iqr = TRUE), NA)
})
ddsjoberg/gtsummary-v0.1 documentation built on June 4, 2019, 7:48 a.m.