snap-tag {doctest} | R Documentation |
@snap
creates a
snapshot test
for your example. It is shorthand for @expect snapshot()
.
Often, examples show complex output to the user. If this output changes, you want to check that it still "looks right". Snapshot tests help by failing when the output changes, and allowing you to review and approve the new output.
#' @doctest #' #' @snap #' summary(lm(Petal.Width ~ Species, data = iris))
Other expectations:
expect-tag
,
expectRaw-tag