From 00e82fd188019dbeec360fcb923a4a0977db13b9 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Tue, 18 Nov 2025 12:51:33 -0500 Subject: [PATCH] clarify about fail() paralleling pass() --- vignettes/custom-expectation.Rmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vignettes/custom-expectation.Rmd b/vignettes/custom-expectation.Rmd index 27b381a88..46da7d410 100644 --- a/vignettes/custom-expectation.Rmd +++ b/vignettes/custom-expectation.Rmd @@ -96,6 +96,8 @@ Next you need to check each way that `object` could violate the expectation. In If the object is as expected, call `pass()`. This ensures that a success will be registered in the test reporter. +Otherwise, call `fail()`. This ensures that a failure will be registered in the test reporter. NB: unlike `stop()` or `abort()`, `fail()` signals a failure but allows code execution to continue, ensuring that one failure does not prevent subsequent expectations from running. + Finally, return the input value (`act$val`) invisibly. This is good practice because expectations are called primarily for their side-effects (triggering a failure), and returning the value allows expectations to be piped together: ```{r}