Skip to content

Commit

Permalink
skip_if_not_installed("rempsyc")
Browse files Browse the repository at this point in the history
  • Loading branch information
rempsyc committed Jun 20, 2024
1 parent 8b64745 commit b9bb500
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions tests/testthat/test-nice_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,25 @@ test_that("nice_fit error on wronb object class", {
)
})

test_that("nice_fit test categorical variable", {
dat <- data.frame(z = sample(c(0, 1), 100, replace = TRUE),
x = sample(1:7, 100, replace = TRUE),
y = sample(1:5, 100, replace = TRUE))
mod <- '
dat <- data.frame(z = sample(c(0, 1), 100, replace = TRUE),
x = sample(1:7, 100, replace = TRUE),
y = sample(1:5, 100, replace = TRUE))
mod <- '
y ~ a*x
z ~ b*y + c*x
ind := a*b
'
fit <- sem(mod, dat, ordered = "z")
fit <- sem(mod, dat, ordered = "z")

test_that("nice_fit test categorical variable", {
expect_s3_class(nice_fit(fit, verbose = FALSE), "data.frame")
})

test_that("nice_fit test categorical variable", {
skip_if_not_installed("rempsyc")
expect_s3_class(
nice_fit(fit, nice_table = TRUE, verbose = FALSE), "flextable"
)
})


0 comments on commit b9bb500

Please sign in to comment.