In this presentation, I introduce what is snapshot testing, why is it
necessary, and its implementation in R in {testthat} package and its
extensions.
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/
This project uses R 4.6.0 or later (declared in DESCRIPTION), Quarto for rendering slides, and just as a command runner.
# Install just (macOS)
brew install justjust installjust 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 previewFeedback and suggestions are welcome in the issue tracker.
