|
1 | 1 | # testthat (development version) |
2 | 2 |
|
3 | 3 | * `snapshot_review()` disables the skip button if there's only one snapshot to review (#2025). |
| 4 | +* `test_dir()`, `test_file()`, `test_package()`, `test_check()`, `test_local()`, `source_file()` gain a `shuffle` argument uses `sample()` to randomly reorder the top-level expressions in each test file (#1942). This random reordering surfaces dependencies between tests and code outside of any test, as well as dependencies between tests. This helps you find and eliminate unintentional dependencies. |
| 5 | +* `snapshot_accept(test)` now works when the test file name contains `.` (#1669). |
| 6 | +* `local_mock()` and `with_mock()` have been deprecated because they are no longer permitted in R 4.5. |
| 7 | +* `snapshot_review()` now passes `...` on to `shiny::runApp()` (#1928). |
| 8 | +* `expect_named()` now gives more informative errors (#2091). |
| 9 | +* `expect_*()` functions consistently and rigorously check their inputs (#1754). |
| 10 | +* `test_that()` no longer warns about the absence of `{}` since it no longer seems to be necessary. |
| 11 | +* `test_that()`, `describe()`, and `it()` can now be arbitrarily nested. Each component will skip only if it and its subtests don't contain any expectations. The interactive stop reporter has been fixed so it doesn't duplicate failures. (#2063, #2188). |
| 12 | +* Test filtering now works with `it()`, and the `desc` argument can take a character vector in order to recursively filter subtests (i.e. `it()` nested inside of `describe()`) (#2118). |
| 13 | +* New `snapshot_reject()` rejects all modified snapshots by deleting the `.new` variants (#1923). |
| 14 | +* New `SlowReporter` makes it easier to find the slowest tests in your package. The easiest way to run it is with `devtools::test(reporter = "slow")` (#1466). |
| 15 | +* Power `expect_mapequal()` with `waldo::compare(list_as_map = TRUE)` (#1521). |
| 16 | +* On CRAN, `test_that()` now automatically skips if a package is not installed (#1585). Practically, this means that you no longer need to check that suggested packages are installed. (We don't do this in the tidyverse because we think it has limited payoff, but other styles advise differently.) |
| 17 | +* `expect_snapshot()` no longer skips on CRAN, as that skips the rest of the test. Instead it just returns, neither succeeding nor failing (#1585). |
4 | 18 | * Interrupting a test now prints the test name. This makes it easier to tell where a very slow test might be hanging (#1464) |
5 | 19 | * Parallel testthat now does not ignore test files with syntax errors (#1360). |
6 | 20 | * `expect_lt()`, `expect_gt()`, and friends have a refined display that is more likely to display the correct number of digits and shows you the actual values compared. |
|
16 | 30 | * `vignette("custom-expectations)` has been overhauled to make it much clearer how to create high-quality expectations (#2113, #2132, #2072). |
17 | 31 | * `expect_snapshot()` and friends will now fail when creating a new snapshot on CI. This is usually a signal that you've forgotten to run it locally before committing (#1461). |
18 | 32 | * `expect_snapshot_value()` can now handle expressions that generate `-` (#1678) or zero length atomic vectors (#2042). |
19 | | -* `expect_matches()` failures should be a little easier to read (#2135). |
| 33 | +* `expect_matches()` failures should be a little easier to read (#2135, #2181). |
20 | 34 | * New `local_on_cran(TRUE)` allows you to simulate how your tests will run on CRAN (#2112). |
21 | 35 | * `expect_no_*()` now executes the entire code block, rather than stopping at the first message or warning (#1991). |
22 | 36 | * `expect_no_failures()` and `expect_no_successes()` are now deprecated as `expect_success()` now test for no failures and `expect_failure()` tests for no successes (#) |
|
0 commit comments