testthat 3.1.8
-
expect_snapshot()differences no longer use quotes. -
expect_error(),expect_warning(), andexpect_message()now correctly
enforce that the condition is of the expected base class (e.g. error,
warning, messsage) even when theclassargument is used (#1168). -
it()now callslocal_test_context()so that it behaves more
similarly totest_that()(#1731), and is now exported so that you
can more easily run BDD tests interactively (#1587) -
skip_on_bioc()now uses the documented environment variable
(IS_BIOC_BUILD_MACHINE) (#1712). -
source_file(), which is used by various parts of the helper and
setup/teardown machinery, now reports the file name in the case of
errors (#1704). -
test_path()now works when called within helper files (#1562). -
New
vignette("special-files")describes the various special files
that testthat uses (#1638). -
with_mocked_bindings()andlocal_mocked_bindings()now also bind in the
imports namespace and can mock S3 methods. These changes make them good
substitutes for the deprecated functionswith_mock()andlocal_mock(), so
those older functions now recommend switching to the newer equivalents
instead of using the mockr or mockery packages.