-
Couldn't load subscription status.
- Fork 340
Closed
Description
I note in
https://testthat.r-lib.org/reference/expect_snapshot_output.html
That expect_snapshot_warning() and co are in a questioning lifecycle.
I personally find it really useful to use expect_snapshot_warning() as a way to capture the entire warning message, and not the output. Is there a recommended way that you'd recommend testing this otherwise? Currently it seems my approach is:
expect_snapshot(
tmp <- function_to_warn(x)
)I understand I can capture an error message with:
expect_snapshot(
error = TRUE,
function_to_warn(x)
)But I want to capture the warning. Is there a recommended approach for the future that you'd recommend users use to capture things like warnings?
Metadata
Metadata
Assignees
Labels
No labels