tests/testthat/test-my_lm.R

data("mtcars")
formula <- mpg ~ hp + wt
data <- mtcars

test_that("Check for error for output type", {
  expect_type(my_lm(formula, data), "list")
})

test_that("Check for error if wrong input type", {
  expect_error(my_lm("string", y ~ x))
})
hadiyusri/project3package documentation built on Dec. 20, 2021, 2:40 p.m.