diff --git a/tests/testthat/helper-custom-expectations.R b/tests/testthat/helper-custom-expectations.R index c83ef0626..80f596821 100644 --- a/tests/testthat/helper-custom-expectations.R +++ b/tests/testthat/helper-custom-expectations.R @@ -39,6 +39,11 @@ expect_gq_output <- function(object, num_chains = NULL) { } expect_interactive_message <- function(object, regexp = NULL) { + # Non-interactive message suppression failing under Windows CI, + # temporarily skip message check only on Windows + if (os_is_windows() && !os_is_wsl()) { + return(object) + } if (interactive()) { expect_message(object = object, regexp = regexp) } else { diff --git a/tests/testthat/test-json.R b/tests/testthat/test-json.R index ab8c0c1ca..1f7fb21b6 100644 --- a/tests/testthat/test-json.R +++ b/tests/testthat/test-json.R @@ -50,8 +50,13 @@ test_that("JSON output for data frame and matrix is correct", { json_output_mat <- readLines(temp_file_df) json_output_df <- readLines(temp_file_mat) expect_identical(json_output_df, json_output_mat) - expect_known_output(cat(json_output_df, sep = "\n"), - file = test_path("answers", "json-df-matrix.json")) + + # Floating-point error introduced in jsonlite 1.8.5 + # https://github.com/jeroen/jsonlite/issues/420 + if (packageVersion("jsonlite") != "1.8.5") { + expect_known_output(cat(json_output_df, sep = "\n"), + file = test_path("answers", "json-df-matrix.json")) + } }) test_that("JSON output for list of vectors is correct", {