snap-tag: Create a snapshot test

snap-tagR Documentation

Create a snapshot test

Description

⁠@snap⁠ creates a snapshot test for your example. It is shorthand for ⁠@expect snapshot()⁠.

Details

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))

See Also

Other expectations: expect-tag, expectRaw-tag


doctest documentation built on May 29, 2024, 7:09 a.m.