ekino / veggies

:sparkles: :rocket: Veggies is an awesome cucumberjs library for API/CLI testing. Great for testing APIs built upon Express, Koa, HAPI, Loopback and others. It's also the perfect companion for testing CLI applications built with commander, meow & Co.
https://ekino.github.io/veggies/
MIT License
90 stars 18 forks source link

fix(snapshot): correct snapshot comparison with carriage returns #37

Closed leguellec closed 4 years ago

leguellec commented 5 years ago

Summary

Veggies use a method named normalizeNewlines on the content before writing the snapshot (and it replace carriage return and line feed (\r\n) with line feed (\n)), . Unfortunately this method is not used on the content when we try to compare it to the previously generated snapshot, and the comparison fail. The change is to apply
normalizeNewlines on the content in the expectToMatchmethod from the snapshot extension

Test plan

Not sure if i put test in the right place ... maybe have to change it :) . Add one functional test in the example sections, but there is also functional test in tests folder but only for snapshot extension ( and don't look very relevant). By the way test a content with CR LF and expect the comparison with the snapshot to match