You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm sorry if that is documented somewhere, but I could not find it in ?expect_snapshot or vignette("snapshotting").
When an error occurs inside a snapshot, it seems that the whole code is interpreted even when an error is thrown, and then only the last error is shown in the build pane.
For better or worse expect_snapshot() copies the behaviour as if you typed the code into the console. We rely on this in a bunch of our snapshot tests so there's no way to change it now.
Hi,
I'm sorry if that is documented somewhere, but I could not find it in
?expect_snapshot
orvignette("snapshotting")
.When an error occurs inside a snapshot, it seems that the whole code is interpreted even when an error is thrown, and then only the last error is shown in the build pane.
Here is a reprex (testthat v3.2.1.1):
In my case,
w
is built from another function that failed with an error, but the snapshot failed atprint(w)
like in my reprex.Is this an expected behavior? Wouldn't it make more sense to stop at the first error, like in a natural R console?
EDIT:
Surprisingly, running
testthat::test_file("tests/testthat/test-quicktest.R")
from the console gives another output, still wrong:Note that the row/col number is still the same (
6:3
)The text was updated successfully, but these errors were encountered: