tests/testthat/test-priors.R

library(shinytest)

test_that("Specification of custom priors", {
  skip_on_cran()
  skip_if_not_installed("MASS")
  
  shinytest::installDependencies()
  app_path <- system.file("shinybrms_app", package = "shinybrms")
  shinytest::expect_pass(shinytest::testApp(app_path, testnames = "priors.R"))
})

test_that("the group for the prior is not automatically set to be empty when not necessary.", {
  skip_on_cran()
  skip_if_not_installed("MASS")
  
  shinytest::installDependencies()
  app_path <- system.file("shinybrms_app", package = "shinybrms")
  shinytest::expect_pass(shinytest::testApp(app_path, testnames = "priors_autoSetEmpty.R"))
})

test_that("if necessary, the group for the prior is automatically reset when switching the class for the prior.", {
  skip_on_cran()
  skip_if_not_installed("MASS")
  
  shinytest::installDependencies()
  app_path <- system.file("shinybrms_app", package = "shinybrms")
  shinytest::expect_pass(shinytest::testApp(app_path, testnames = "priors_switchClass.R"))
})
fweber144/shinybrms documentation built on April 11, 2024, 11:17 p.m.