# tests/testthat/test-smoke.R library(testthat) library(apaTablesPlus) test_that("basic functions run without error (console output suppressed)", { set.seed(1) d <- data.frame( y = rnorm(20), x = rnorm(20), g = factor(sample(c("A","B"), 20, TRUE)), id = 1:20 ) # OLS table m <- lm(y ~ x, data = d) expect_no_error( suppressMessages(capture.output(apa_table(m, output = "console"))) ) # Descriptives expect_no_error( suppressMessages(capture.output( apa_descriptives(d, vars = "y", group = "g", output = "console") )) ) # ANOVA a <- aov(y ~ g, data = d) expect_no_error( suppressMessages(capture.output( apa_anova(a, type = "II", es = "eta2", output = "console") )) ) # Post-hoc expect_no_error( suppressMessages(capture.output( apa_posthoc(a, by = "g", output = "console") )) ) })