tests/testthat/test-sig-testing.R

context("Helper - significance testing")

test_that("Errors properly", {
  dat <- data.frame(
    mps = rep(1:4, each = 2),
    y = rnorm(8),
    z = c(0, 1)
  )

  expect_warning(
    lm_lin(y ~ z, ~ factor(mps), data = dat),
    "Some degrees of freedom have been estimated as negative or zero"
  )

  expect_error(
    lm_robust(y ~ z, data = dat, alpha = 10),
    "`alpha` must be numeric between 0 and 1"
  )
})
DeclareDesign/estimatr documentation built on Dec. 18, 2018, 6:56 a.m.