From 3a9d5646b166b3f7174bca6622bb935091df84e2 Mon Sep 17 00:00:00 2001 From: Emil Hvitfeldt Date: Mon, 27 Jan 2025 11:43:59 -0800 Subject: [PATCH] no more expect_error() --- tests/testthat/test-fiting.R | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/testthat/test-fiting.R b/tests/testthat/test-fiting.R index 3d58f22e..8dc1e5a3 100644 --- a/tests/testthat/test-fiting.R +++ b/tests/testthat/test-fiting.R @@ -1,7 +1,6 @@ test_that("fit and fit_xy errors if outcome is provided", { - expect_error( - k_means(num_clusters = 5) %>% fit_xy(mtcars), - regexp = NA + expect_no_error( + k_means(num_clusters = 5) %>% fit_xy(mtcars) ) expect_snapshot( @@ -12,9 +11,8 @@ test_that("fit and fit_xy errors if outcome is provided", { km <- k_means(num_clusters = 5) - expect_error( - workflows::workflow(~., km) %>% fit(mtcars), - regexp = NA + expect_no_error( + workflows::workflow(~., km) %>% fit(mtcars) ) expect_snapshot( error = TRUE,