rspec_junit_formatter
rspec_junit_formatter copied to clipboard
Replace invalid characters with a placeholder
It seems that when tests print an emoji in the failure reason rspec_junit_formatter fails and prints the xml its already generated to that point which ends up being invalid because it creates an xml element with a missing closing brackets and that cannot be parsed by the tools that attempt to read it.
This fix causes invalid characters to be replaced with ??invalid?? instead of bailing out immediately. rspec_junit_formatter shouldn't output invalid xml regardless of the failures it encounters along the way.
This should fix this issue: https://github.com/sj26/rspec_junit_formatter/issues/92
This would be useful 👍🏼
Tested this on our CI, fixed similar error with invalid XML.