New expectations
-
expect_s7_class()
tests if an object is an S7 class (#1580). -
expect_no_failure()
,expect_no_success()
andexpect_snapshot_failure()
provide more options for testing expectations.
Bug fixes and minor improvements
-
testthat now requires waldo 0.6.0 or later to access the latest features
(#1955). -
expect_condition()
and related functions now include theclass
of the
expected condition in the failure message, if provided (#1987). -
expect_error()
and friends now error if you supply...
but notpattern
(#1932). They no longer give an uninformative error if they fail inside
a magrittr pipe (#1994). -
expect_no_*()
expectations no longer incorrectly emit a passing test result
if they in fact fail (#1997). -
expect_setequal()
correctly identifies what is missing where (#1962). -
expect_snapshot()
now strips line breaks in test descriptions
(@LDSamson, #1900), and errors when called from atest_that()
that has an
empty description (@kevinushey, #1980). -
expect_true()
andexpect_false()
give better errors ifactual
isn't a
vector (#1996). -
expect_visible()
andexpect_invisible()
have clearer failure messages
(#1966). -
local_reproducible_output()
(used intest_that()
blocks) now sets
LANGUAGE
to"C"
instead of"en"
to disable translations,
avoiding warnings on some platforms (#1925). -
skip_if_not_installed()
generates a clearer message that sorts better
(@MichaelChirico, #1959). -
with_mock()
andlocal_mock()
have been unconditionally deprecated as
they will no longer work in future versions of R (#1999).