From 162d325d7855ae026b8745b2a9ed7bd5c4bfa923 Mon Sep 17 00:00:00 2001 From: "Mattan S. Ben-Shachar" Date: Sun, 30 Jul 2023 09:51:46 +0300 Subject: [PATCH] fix some tests --- tests/testthat/test-bayesfactor_models.R | 2 -- tests/testthat/test-format.R | 4 ++-- tests/testthat/test-p_map.R | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-bayesfactor_models.R b/tests/testthat/test-bayesfactor_models.R index 24fe273ae..27294b874 100644 --- a/tests/testthat/test-bayesfactor_models.R +++ b/tests/testthat/test-bayesfactor_models.R @@ -118,8 +118,6 @@ test_that("bayesfactor_models BRMS", { skip_on_cran() skip_on_ci() - skip_if_not_or_load_if_installed("lme4") - skip_if_not_or_load_if_installed("rstanarm") skip_if_not_or_load_if_installed("bridgesampling") skip_if_not_or_load_if_installed("brms") diff --git a/tests/testthat/test-format.R b/tests/testthat/test-format.R index c8e0377a5..08297ed2a 100644 --- a/tests/testthat/test-format.R +++ b/tests/testthat/test-format.R @@ -23,12 +23,12 @@ test_that("p_significance", { ) expect_equal( format(p_direction(x)), - data.frame(x = "0.51", stringsAsFactors = FALSE), + data.frame(x = "51.00%", stringsAsFactors = FALSE), ignore_attr = TRUE ) expect_equal( format(p_map(x)), - data.frame(x = "0.97", stringsAsFactors = FALSE), + data.frame(x = "0.973", stringsAsFactors = FALSE), ignore_attr = TRUE ) expect_equal( diff --git a/tests/testthat/test-p_map.R b/tests/testthat/test-p_map.R index 85df6a948..88514c446 100644 --- a/tests/testthat/test-p_map.R +++ b/tests/testthat/test-p_map.R @@ -47,6 +47,6 @@ test_that("p_map", { test_that("p_map | null", { x <- distribution_normal(4000, mean = 1) - expect_equal(p_map(x), 0.6194317, ignore_attr = TRUE, tolerance = 0.01) - expect_equal(p_map(x, null = 1), 1, ignore_attr = TRUE, tolerance = 0.01) + expect_equal(as.numeric(p_map(x)), 0.6194317, ignore_attr = TRUE, tolerance = 0.01) + expect_equal(as.numeric(p_map(x, null = 1)), 1, ignore_attr = TRUE, tolerance = 0.01) })