tests/testthat/test-apastylr.R

test_that("apastylr does not throw an error when used as intended", {
  data(ho_et_al)
  test <- lm(hypodescent ~ linkedfate, ho_et_al)
  expect_silent(apastylr(test, "linkedfate"))
})

test_that("Correctly reports p < .001", {
  data(ho_et_al)
  test <- lm(hypodescent ~ linkedfate, ho_et_al)
  expect_output(print(apastylr(test, "linkedfate")), "< .001")
})

test_that("apastylr throws a warning when `term` des not exists", {
  data(ho_et_al)
  test <- lm(hypodescent ~ linkedfate, ho_et_al)
  expect_error(apastylr(test, "somethingelse"))
})

Try the JSmediation package in your browser

Any scripts or data that you put into this service are public.

JSmediation documentation built on Feb. 16, 2023, 7:25 p.m.