Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 23, 2024
1 parent 8e334da commit e14ebc8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion tests/testthat/test-brms.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 -----------------------------------------------------------

Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit e14ebc8

Please sign in to comment.