r-lib / testthat

An R 📦 to make testing 😀
https://testthat.r-lib.org
Other
869 stars 313 forks source link

Remove linebreaks from test descriptions in snapshots; fixes #1900 #1902

Open LDSamson opened 7 months ago

LDSamson commented 7 months ago

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 commented 7 months ago

I don't know why the test-coverage GitHub Action it failing though..