Skip to content

Commit

Permalink
Capture snapshot of error
Browse files Browse the repository at this point in the history
  • Loading branch information
markfairbanks committed Oct 13, 2022
1 parent f9439f3 commit 6d29fb3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/testthat/_snaps/step-colorder-relocate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# can only supply one of .before and .after

Code
relocate(dt, y, .before = x, .after = x)
Condition
Error in `relocate()`:
! Can't supply both `.before` and `.after`.

2 changes: 1 addition & 1 deletion tests/testthat/test-step-colorder-relocate.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ test_that("no .before/.after moves to front", {
test_that("can only supply one of .before and .after", {
dt <- lazy_dt(data.table(x = 1, y = 1), "DT")

expect_error(relocate(dt, y, .before = x, .after = x))
expect_snapshot(relocate(dt, y, .before = x, .after = x), error = TRUE)
})

test_that("relocate() respects order specified by ...", {
Expand Down

0 comments on commit 6d29fb3

Please sign in to comment.