You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rework expectations to call `pass()` and `fail()` purely for their side-effects, and then ensure that every expectation returns the first argument invisibly.
Fixes#2246
Copy file name to clipboardExpand all lines: NEWS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# testthat (development version)
2
2
3
+
* Expectations now consistently return the value of the first argument, regardless of whether the expectation succeeds or fails. The primary exception are `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).
3
4
*`set_state_inspector()` gains `tolerance` argument and ignores minor FP differences by default (@mcol, #2237).
4
5
*`expect_vector()` fails, instead of erroring, if `object` is not a vector (@plietar, #2224).
5
6
* New `vignette("mocking")` explains mocking in detail (#1265).
0 commit comments