testthat 3.0.3
-
expect_snapshot_file()
gains acompare
argument (#1378,
@nbenn). This is a customisation point for how to compare old and
new snapshot files.The functions
compare_file_binary()
andcompare_file_text()
are
now exported from testthat to be supplied ascompare
argument. These implement the same behaviour as the oldbinary
argument which is now deprecated. -
expect_snapshot()
no longer deletes snapshots when an unexpected
error occurs. -
New
announce_snapshot_file()
function for developers of testthat
extensions. Announcing a snapshot file allows testthat to preserve
files that were not generated because of an unexpected error or a
skip()
(#1393). Unannounced files are automatically deleted during
cleanup if the generating code isn't called. -
New expectation:
expect_no_match()
. It complementsexpect_match()
by
checking if a string doesn't match a regular expression
(@michaelquinn32, #1381). -
Support setting the testthat edition via an environment variable
(TESTTHAT_EDITION
) as well (@michaelquinn32, #1386).