testthat icon indicating copy to clipboard operation
testthat copied to clipboard

Provide a set of default transformers for snapshot tests?

Open kevinushey opened this issue 2 years ago • 1 comments

Motivated by what we've added in renv, it feels like some subset could be useful more broadly in testthat. (The primary motivation: it can be frustrating when you try to write a snapshot test only to find it fails on Windows on CI because of something OS-specific.)

Some options:

  • R version,
  • Package version(s),
  • Working directory (including aliased paths?)
  • R temporary directory (including aliased paths?)
  • Repository paths,
  • Library paths,
  • Elapsed times?

kevinushey avatar Jun 15 '23 04:06 kevinushey

And it would be convenient if transformer could take a list of functions.

hadley avatar Jul 26 '23 19:07 hadley

I haven't felt the itch for the helpers I think it's probably better to create on a case-by-case basis.

hadley avatar Aug 07 '25 16:08 hadley