Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error location for snapshot tests with error = TRUE #1280

Closed
krlmlr opened this issue Dec 13, 2020 · 1 comment · Fixed by #1281
Closed

Error location for snapshot tests with error = TRUE #1280

krlmlr opened this issue Dec 13, 2020 · 1 comment · Fixed by #1281

Comments

@krlmlr
Copy link
Member

krlmlr commented Dec 13, 2020

In current tibble I'm seeing:

───────────────────────────────────────────────────────
Failure (snapshot.R:67:5): output test
`{ ... }` threw an unexpected error.
Message: `x` must not have more than one dimension. `length(dim(x))` must be zero or one, not 4.
Class:   tibble_error_enframe_has_dim/tibble_error/rlang_error/error/condition
Backtrace:
 1. tibble::enframe(Titanic)
───────────────────────────────────────────────────────

The snapshot.R:67:5 is not particularly helpful here.

@krlmlr
Copy link
Member Author

krlmlr commented Dec 13, 2020

Tibble had code of the form

test_that("desc", expect_snapshot({
}))

TIL this is a bad idea (and why), the pull request adds a warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant