testthat icon indicating copy to clipboard operation
testthat copied to clipboard

Remove linebreaks from test descriptions in snapshots; fixes #1900

Open LDSamson opened this issue 7 months ago • 1 comments

This would fix issue #1900.

Newline ("\n") arguments in test descriptions are problematic for snapshots. They are converted to actual line breaks when writing the snapshot to a .md file here, causing a discrepancy between the test name in the snapshot (first line of the test, cut short at the newline argument) and the actual test name with newline arguments.

I think the easiest solution is to just remove the newline arguments in the test description within SnapshotReporter.

LDSamson avatar Nov 26 '23 12:11 LDSamson