Skip to content

Commit

Permalink
don't test contents of hardhat error (closes #278)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Jan 10, 2025
1 parent be22aac commit cba16db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
16 changes: 0 additions & 16 deletions tests/testthat/_snaps/pre-action-case-weights.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,3 @@
# case weights + recipe can optionally require case weights at predict time

Code
predict(wf, df)
Condition
Error in `validate_column_names()`:
! The required column "w" is missing.

# case weights + recipe requires extra roles at predict time by default

Code
predict(wf, df)
Condition
Error in `validate_column_names()`:
! The required column "w" is missing.

# case weights + recipe doesn't allow the recipe to drop the case weights column

Code
Expand Down
14 changes: 8 additions & 6 deletions tests/testthat/test-pre-action-case-weights.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,10 @@ test_that("case weights + recipe can optionally require case weights at predict

df$w <- NULL

expect_snapshot(error = TRUE, {
predict(wf, df)
})
# missing case weights error--don't snapshot test so as not to be
# sensitive to the wording of the error message (#278)
skip_on_cran()
expect_error(predict(wf, df), regexp = "missing")
})

test_that("case weights + recipe requires extra roles at predict time by default", {
Expand Down Expand Up @@ -239,9 +240,10 @@ test_that("case weights + recipe requires extra roles at predict time by default

df$w <- NULL

expect_snapshot(error = TRUE, {
predict(wf, df)
})
# missing case weights error--don't snapshot test so as not to be
# sensitive to the wording of the error message (#278)
skip_on_cran()
expect_error(predict(wf, df), regexp = "missing")
})

test_that("case weights + recipe can optionally not require extra roles at predict time", {
Expand Down

0 comments on commit cba16db

Please sign in to comment.