testthat icon indicating copy to clipboard operation
testthat copied to clipboard

Extend `variant` in snapshot testing

Open pawelru opened this issue 5 months ago • 0 comments

For more sophisticated testing strategy (e.g. multiple mutually exclusive sets of variants: a1/a2/a3/... in conjunction with b1/b2/b3/... in conjunction with ...) it would be great to extend variant argument to accept a representation of directory structure. It could be a string representing path (e.g. string a1/b1/c1 which creates _snaps/a1/b1/c1 directory) or vector of strings (e.g. c("a1", "b1", "c1") which creates _snaps/a1/b1/c1). Right now it's needed to collapse that structure into a single string (e.g. "a1_b1_c1") which then creates many many directories under _snaps. This is not super convenient to browse and use.

pawelru avatar Mar 05 '24 13:03 pawelru