Skip to content

testthat 3.0.3

Compare
Choose a tag to compare
@lionel- lionel- released this 17 Jun 05:16
· 59 commits to master since this release
  • expect_snapshot_file() gains a compare argument (#1378,
    @nbenn). This is a customisation point for how to compare old and
    new snapshot files.

    The functions compare_file_binary() and compare_file_text() are
    now exported from testthat to be supplied as compare
    argument. These implement the same behaviour as the old binary
    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 complements expect_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).