#' @title
#' Helper function to perform snapshot testing for whole .CSV files.
#'
#' @description
#' The \code{expect_snapshot_csv()} writes and compares new tibble to a
#' .CSV file.
#'
#' @param name
#' Name of the .CSV file.
#'
#' @param timber
#' A tibble of timber.
#'
#' @export
expect_snapshot_csv <- function(name, timber) {
name_ext <- paste0(
name,
".csv"
)
testthat::announce_snapshot_file(name = name)
path <- write_tibble_to_csv(timber, name)
testthat::expect_snapshot_file(path, name_ext)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.