Skip to content

IndrajeetPatil/intro-to-snapshot-testing

Repository files navigation

Introduction to snapshot (aka golden) testing (in R)

In this presentation, I introduce what is snapshot testing, why is it necessary, and its implementation in R in {testthat} package and its extensions.

Logos Combined

In particular, the presentation provides a detailed account of how these tests are valuable in testing:

  • text outputs
  • graphical outputs
  • Shiny apps
  • entire files

Slides can be seen here: https://www.indrapatil.com/intro-to-snapshot-testing/

Development

This project uses R 4.6.0 or later (declared in DESCRIPTION), Quarto for rendering slides, and just as a command runner.

Prerequisites

# Install just (macOS)
brew install just

Setup

just install

Just Commands

just help     # Show all available commands
just install  # Install R dependencies from DESCRIPTION
just render   # Render slides to HTML
just preview  # Start a live preview with auto-reload
just open     # Alias for preview (live-reload dev server over localhost)
just clean    # Remove generated files and caches
just check    # Check the Quarto and R version setup
just          # Install dependencies and start live-reload preview

Feedback

Feedback and suggestions are welcome in the issue tracker.

About

Introduction to snapshot (aka golden) testing (in R)

Topics

Resources

License

Stars

22 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors