graphic regressions - janeshdev/ggplot2 GitHub Wiki

Regression tests for graphics

Options for output:

  • Rdata containing grid grobs (one per expectation? or test? or context? or package?)
  • Raster image: png
  • Vector image: pdf/svg

Probably best to store as grid grobs (because has the most information), but if different, display a diff on the binary images (as that's the simplest to calculate and visualise)

Need way to initialise, to say that this graphic looks ok. Also need way to reset - to say that this change is ok, it's not an important difference or it is as expected.

expect_unchanged(name, object)

  • name needs to be package unique
  • as_expected(name, cache_path)

expect_graphic_unchanged(name, plot)

  • if there is a difference, displays in some way - html?
⚠️ **GitHub.com Fallback** ⚠️