Skip to content

Error location for snapshot tests with error = TRUE #1280

Closed

Description

@krlmlr

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.

Activity

  1. krlmlr commented on Dec 13, 2020

    @krlmlr
    MemberAuthor

    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.

  2. added a commit that references this issue on Dec 14, 2020
    92694a7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions