diff --git a/.covrignore b/.covrignore index 6497a0e..ba0a9a3 100644 --- a/.covrignore +++ b/.covrignore @@ -5,7 +5,6 @@ ./R/NewLayer.R ./R/NewMetaLayer.R ./R/NewStudy.R -./R/predict.weightedMeanLearner.R ./R/PredictData.R ./R/PredictLayer.R ./R/PredictMetaLayer.R diff --git a/tests/testthat/test-weightedMeanLearner.R b/tests/testthat/test-weightedMeanLearner.R index 9cc541b..6dd783a 100644 --- a/tests/testthat/test-weightedMeanLearner.R +++ b/tests/testthat/test-weightedMeanLearner.R @@ -4,6 +4,16 @@ test_that("weightedMeanLearner works", { x = data.frame(x1 = rnorm(50L)) y = sample(x = 0L:1L, size = 50L, replace = TRUE) my_model = weightedMeanLearner(x = x, y = y) + x_new <- data.frame(x1 = rnorm(10)) + my_predictions <- predict(object = my_model, data = x_new) + }) + expect_error({ + set.seed(20240624L) + x = data.frame(x1 = rnorm(50L)) + y = sample(x = 0L:1L, size = 50L, replace = TRUE) + my_model = weightedMeanLearner(x = x, y = y) + x_new <- data.frame(x2 = rnorm(10)) + my_predictions <- predict(object = my_model, data = x_new) }) expect_error({ set.seed(20240624L)