Skip to content

Commit da87e2c

Browse files
committed
First pass at organising NEWS.md
1 parent aedba45 commit da87e2c

File tree

2 files changed

+74
-44
lines changed

2 files changed

+74
-44
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ revdep/checks
88
revdep/library
99
log/runit.html
1010
log/runit.log
11+
12+
/.quarto/

NEWS.md

Lines changed: 72 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -8,61 +8,89 @@
88
* `expect_vector()` fails, instead of erroring, if `object` is not a vector (@plietar, #2224).
99
* New `vignette("mocking")` explains mocking in detail (#1265).
1010
* New `vignette("challenging-functions")` provides an index to other documentation organised by testing challenges (#1265).
11+
## Lifecycle changes
12+
13+
* testthat now requires R 4.1.
14+
* `expect_snapshot(binary)` is now fully deprecated; it was soft deprecated in v3.0.3.
15+
* `is_null()`/`matches()` deprecated in 2.0.0 (2017-12-19) and `is_true()`/`is_false()` deprecated in 2.1.0 (2019-04-23) have been removed (#2109).
16+
* `local_mock()` and `with_mock()` have been made defunct because they are no longer permitted in R 4.5.
17+
* `test_files(wrap)` has now been removed; it was deprecated in v3.0.0.
18+
19+
## New expectations
20+
21+
* The failure messages for all `expect_` functions have been rewritten to first state what was expected and then what was actually received (#2142). They also functions consistently and rigorously check their inputs (#1754).
22+
* Expectations now consistently return the value of the first argument, regardless of whether the expectation succeeds or fails (the only exception is `expect_message()` and friends which will return the condition). This shouldn't affect existing tests, but will make failures clearer when you chain together multiple expectations (#2246).
1123
* When running a test interactively, testthat now reports the number of successes. The results should also be more useful if you are using nested tests.
12-
* The hints generated by `expect_snapshot()` and `expect_snapshot_file()` now include the path to the package, if it's not in the current working directory (#1577).
13-
* `expect_snapshot_file()` now clearly errors if the `path` doesn't exist (#2191).
14-
* `expect_snapshot_file()` now considers `.json` to be a text file (#1593).
15-
* `expect_snapshot_file()` now shows differences for text files (#1593).
16-
* The failure messages for all `expect_` functions have been rewritten to first state what was expected and then what was actually received (#2142).
17-
* `test_file(desc = ...)` no longer loses snapshot results (#2066).
18-
* In `R CMD check`, snapshots now only advise on how to resolve failures once (#2207).
19-
* `snapshot_review()` includes a reject button and only displays the file navigation and the skip button if there are multiple files to review (#2025).
20-
* New `snapshot_download_gh()` makes it easy to get snapshots off GitHub and into your local package (#1779).
24+
25+
* New `expect_all_equal()`, `expect_all_true()`, and `expect_all_false()` are a family of expectations that checks that every element of a vector has the same value. Compared to using `expect_true(all(...))` they give better failure messages (#1836, #2235).
26+
* New `expect_disjoint()` to check for the absence of values (@stibu81, #1851).
27+
* New `expect_r6_class()` (#2030).
28+
* New `expect_shape()` for testing the shape (i.e., the `nrow()`, `ncol()`, or `dim()`) (#1423, @michaelchirico).
29+
30+
* `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). `describe()`, `it()`, and `test_that()` now have a shared stack of descriptions so that if you nest any inside of each other, any resulting failures will show you the full path.
31+
32+
* `vignette("custom-expectations")` has been overhauled to make it much clearer how to create high-quality expectations (#2113, #2132, #2072).
33+
* New `pass()` function to use in place of `succeed()` (#2113).
34+
* `expectation()` is now a combination of `new_expectation()` and `exp_signal()` (#2125).
35+
* `expect_no_failures()` and `expect_no_successes()` are now deprecated as `expect_success()` also tests for the absence of failures and `expect_failure()` tests for the absence of successes.
36+
37+
* 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 check the installation of suggested packages in the tidyverse because we think it has limited payoff, but other styles advise differently.)
38+
39+
## Other new features
40+
2141
* New `local_mocked_s3_method()`, `local_mocked_s4_method()`, and `local_mocked_r6_class()` allow you to mock S3 and S4 methods and R6 classes (#1892, #1916)
22-
* `expect_snapshot_file(name=)` must have a unique file path. If a snapshot file attempts to be saved with a duplicate `name`, an error will be thrown. (#1592)
42+
* New `local_on_cran(TRUE)` allows you to simulate how your tests will run on CRAN (#2112).
2343
* `test_dir()`, `test_file()`, `test_package()`, `test_check()`, `test_local()`, `source_file()` gain a `shuffle` argument that 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.
24-
* `snapshot_accept(test)` now works when the test file name contains `.` (#1669).
25-
* `local_mock()` and `with_mock()` have been deprecated because they are no longer permitted in R 4.5.
26-
* `snapshot_review()` now passes `...` on to `shiny::runApp()` (#1928).
27-
* `expect_named()` now gives more informative errors (#2091).
28-
* `expect_*()` functions consistently and rigorously check their inputs (#1754).
29-
* `test_that()` no longer warns about the absence of `{}` since it no longer seems to be necessary.
30-
* `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).
31-
* 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).
32-
* New `snapshot_reject()` rejects all modified snapshots by deleting the `.new` variants (#1923).
44+
* `try_again()` is now publicised. The first argument is now the number of retries, not tries (#2050).
45+
* New `skip_unless_r()` to skip running tests on unsuitable versions of R, e.g. `skip_unless_r(">= 4.1.0")` to skip tests that require, say, `...names` (@MichaelChirico, #2022)
3346
* 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).
34-
* 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.)
47+
* New `vignette("mocking")` explains mocking in detail (#1265).
48+
* New `vignette("challenging-functions")` provides an index to other documentation organised by testing challenges (#1265).
49+
50+
## Snapshotting
51+
52+
New features:
53+
54+
* `snapshot_reject()` rejects all modified snapshots by deleting the `.new` variants (#1923).
55+
* `snapshot_download_gh()` makes it easy to get snapshots off GitHub and into your local package (#1779).
56+
57+
Behaviour changes:
58+
3559
* `expect_snapshot()` no longer skips on CRAN, as that skips the rest of the test. Instead it just returns, neither succeeding nor failing (#1585).
36-
* Interrupting a test now prints the test name. This makes it easier to tell where a very slow test might be hanging (#1464).
37-
* Parallel testthat now does not ignore test files with syntax errors (#1360).
38-
* `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.
39-
* `describe()`, `it()`, and `test_that()` now have a shared stack of descriptions so that if you nest any inside of each other, any resulting failures will show you the full path.
40-
* `describe()` now correctly scopes `skip()` (#2007).
41-
* `ParallelProgressReporter` now respect `max_failures` (#1162).
42-
* The last snapshot is no longer lost if the snapshot file is missing the final newline (#2092). It's easy to accidentally remove this because there are two trailing new lines in snapshot files and many editors will automatically remove if you touch the file.
43-
* New `expect_r6_class()` (#2030).
44-
* `expect_*()` functions consistently and rigorously check their inputs (#1754).
45-
* `JunitReporter()` no longer fails with `"no applicable method for xml_add_child"` for warnings outside of tests (#1913). Additionally, warnings now save their backtraces.
46-
* `JunitReporter()` strips ANSI escapes in more places (#1852, #2032).
47-
* `try_again()` is now publicised. The first argument is now the number of retries, not tries (#2050).
48-
* `vignette("custom-expectations")` has been overhauled to make it much clearer how to create high-quality expectations (#2113, #2132, #2072).
4960
* `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).
61+
* In `R CMD check`, snapshots now only advise on how to resolve failures once (#2207).
62+
63+
Bug fixes:
64+
65+
* The last snapshot is no longer lost if the snapshot file is missing the final newline (#2092). It's easy to accidentally remove this because there are two trailing new lines in snapshot files and many editors will automatically remove if you touch the file.
66+
* `snapshot_accept(test)` now works when the test file name contains `.` (#1669).
67+
* `expect_snapshot_file()` now clearly errors if the `path` doesn't exist (#2191), or has been used alreaday (#1592) considers `.json` to be a text file (#1593), and shows differences for text files (#1593).
68+
* `expect_snapshot()` and `expect_snapshot_file()` hints now include the path to the package, if it's not the current working directory (#1577).
5069
* `expect_snapshot_value()` can now handle expressions that generate `-` (#1678) or zero length atomic vectors (#2042).
70+
* `snapshot_review()` includes a reject button and only displays the file navigation and the skip button if there are multiple files to review (#2025). It now passes `...` on to `shiny::runApp()` (#1928).
71+
72+
## Minor improvements and bug fixes
73+
74+
* Interrupting a test now prints the test name. This makes it easier to tell where a very slow test might be hanging (#1464).
75+
* Parallel testing:
76+
* `ParallelProgressReporter` now respects `max_failures` (#1162)
77+
* Test files with syntax errors are no longer silently ignored (#1360).
78+
* BDD:
79+
* `it()` now finds the correct evaluation environment in more cases (@averissimo, #2085).
80+
* `describe()` now correctly scopes `skip()` (#2007).
81+
* Fixed an issue preventing compilation from succeeding due to deprecation / removal of `std::uncaught_exception()` (@kevinushey, #2047).
82+
* `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 (#2006). They have a better display for non-numeric data (@stibu81, #2268).
5183
* `expect_matches()` failures should be a little easier to read (#2135, #2181).
52-
* New `local_on_cran(TRUE)` allows you to simulate how your tests will run on CRAN (#2112).
5384
* `expect_no_*()` now executes the entire code block, rather than stopping at the first message or warning (#1991).
54-
* `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 (#)
55-
* New `pass()` function to use in place of `succeed()` (#2113).
56-
* `expectation()` is now a combination of `new_expectation()` and `exp_signal()` (#2125).
57-
* `is_null()`/`matches()` deprecated in 2.0.0 (2017-12-19) and `is_true()`/`is_false()` deprecated in 2.1.0 (2019-04-23) have been removed (#2109).
58-
* `local_edition()` now gives a useful error for bad values (#1547).
59-
* testthat now requires R 4.1.
85+
* `expect_named()` now gives more informative errors (#2091).
6086
* `expect_s4_class()` now supports unquoting (@stibu81, #2064).
61-
* `it()` now finds the correct evaluation environment in more cases (@averissimo, #2085).
62-
* Fixed an issue preventing compilation from succeeding due to deprecation / removal of `std::uncaught_exception()` (@kevinushey, #2047).
63-
* New `skip_unless_r()` to skip running tests on unsuitable versions of R, e.g. `skip_unless_r(">= 4.1.0")` to skip tests that require, say, `...names` (@MichaelChirico, #2022)
87+
* `expect_vector()` fails, instead of erroring, if `object` is not a vector (@plietar, #2224).
88+
* `JunitReporter()` no longer fails with `"no applicable method for xml_add_child"` for warnings outside of tests (#1913). Additionally, warnings now save their backtraces. `JunitReporter()` strips ANSI escapes in more places (#1852, #2032).
89+
* `local_edition()` now gives a useful error for bad values (#1547).
90+
* `set_state_inspector()` gains `tolerance` argument and ignores minor FP differences by default (@mcol, #2237).
91+
* `test_file(desc = ...)` (i.e. test filtering) no longer loses snapshot results (#2066), works with `it()`, and can now be character vector in order to recursively filter subtests (#2118).
92+
* `test_that()` no longer warns about the absence of `{}` since it no longer seems to be necessary.
6493
* `skip_on_os()` gains an option `"emscripten"` of the `os` argument to skip tests on Emscripten (@eitsupi, #2103).
65-
* New expectation, `expect_shape()`, for testing the shape (i.e., the `nrow()`, `ncol()`, or `dim()`), all in one place (#1423, @michaelchirico).
6694

6795
# testthat 3.2.3
6896

0 commit comments

Comments
 (0)