library(testthat)
my_function <- function() {
message("some_message")
message("some_other_message")
}
test_that("can pipe without named args for expect_messages", {
my_function() |>
expect_message("some_message") |>
expect_message("some_other_message")
})
#> ββ Failure: can pipe without named args for expect_messages ββββββββββββββββββββ
#> Expected `expect_message(my_function(), "some_message")` to produce messages.
#> Error:
#> ! Test failed with 1 failure and 1 success.
Created on 2026-07-06 with reprex v2.1.1
Created on 2026-07-06 with reprex v2.1.1