From ddd05636c3a02ec503ebea334da106b67b9ffa01 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 13 Dec 2024 22:06:04 +0100 Subject: [PATCH] fix test --- DESCRIPTION | 1 + tests/testthat/test-brms.R | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 88c731af..0fcfa543 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -44,6 +44,7 @@ Imports: stats, utils Suggests: + BH, brms, coda, correlation, diff --git a/tests/testthat/test-brms.R b/tests/testthat/test-brms.R index a71177b7..ab8695aa 100644 --- a/tests/testthat/test-brms.R +++ b/tests/testthat/test-brms.R @@ -1,16 +1,15 @@ skip_on_os("windows") +skip_if_not_installed("brms") +skip_if_not_installed("BH") +skip_if_not_installed("emmeans") test_that("estimate_means - brms", { - skip_if_not_installed("brms") - skip_if_not_installed("emmeans") model <- brms::brm(Sepal.Length ~ Species * Sepal.Width, data = iris, refresh = 0, iter = 1000) estim <- estimate_means(model) expect_identical(dim(estim), c(3L, 5L)) }) test_that("estimate_relation - brms", { - skip_if_not_installed("brms") - skip_if_not_installed("emmeans") model <- brms::brm(Sepal.Length ~ Species * Sepal.Width, data = iris, refresh = 0, iter = 1000) estim <- estimate_relation(model, preserve_range = FALSE) expect_identical(dim(estim), c(30L, 6L)) @@ -20,8 +19,6 @@ test_that("estimate_relation - brms", { }) test_that("estimate_means - brms", { - skip_if_not_installed("brms") - skip_if_not_installed("emmeans") model <- brms::brm(Sepal.Length ~ Species * Sepal.Width, data = iris, refresh = 0, iter = 1000) estim <- estimate_slopes(model, by = "Species") expect_identical(dim(estim), c(3L, 5L))