From e14ebc80d20fed993615ae4d46b7791548c58c02 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 23 Jul 2024 11:29:40 +0200 Subject: [PATCH] add test --- DESCRIPTION | 1 + NEWS.md | 3 +++ tests/testthat/test-brms.R | 10 +++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index d4fac5a1e..b28592344 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -214,3 +214,4 @@ Roxygen: list(markdown = TRUE) Config/testthat/edition: 3 Config/testthat/parallel: true Config/Needs/website: easystats/easystatstemplate +Config/Needs/check: stan-dev/cmdstanr diff --git a/NEWS.md b/NEWS.md index 9513aa901..0442975d7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -16,6 +16,9 @@ minimum required package version based on the SUGGEST field of the _insight_ package, instead of the package that was calling the function. +* Fixed issue in `get_modelmatrix()` for models from package *brms* with + special functions in the formula (like `mo()`). + # insight 0.20.2 ## New supported models diff --git a/tests/testthat/test-brms.R b/tests/testthat/test-brms.R index fd712b057..007ece3d8 100644 --- a/tests/testthat/test-brms.R +++ b/tests/testthat/test-brms.R @@ -2,7 +2,7 @@ skip_on_cran() skip_if_offline() skip_on_os("mac") skip_if_not_installed("brms") -skip_if_not_installed("httr") +skip_if_not_installed("httr2") # Model fitting ----------------------------------------------------------- @@ -513,6 +513,14 @@ test_that("find_algorithm", { ) }) +test_that("get_modelmatrix", { + out <- get_modelmatrix(m1) + expect_named(out, c("(Intercept)", "Age", "Base", "Trt1")) + m9 <- insight::download_model("brms_mo2") + skip_if(is.null(m9)) + out <- get_modelmatrix(m9) + expect_named(out, c("(Intercept)", "gear")) +}) test_that("get_priors", { expect_equal(