Open sj26 opened 7 years ago
For some context, here's some output from a formatted result (which is also kinda broken for other reasons):
We're definitely open to an improvement here. Want to take a stab at it?
Following. I am having the same problem. Were you able to fix this @sj26
@myronmarston thanks for the blessing! I've pushed a hacky workaround into the junit formatter for now, but I'll take a stab at some diff colour options in here real soon now(tm).
Howdy! π I maintain rspec_junit_formatter. It presents results in a junit xml file so that services like Jenkins can consume test results and display them richly in HTML. Currently it consumes example notifications quite nicely and can choose to use the un-colorized versions of the various strings by choosing different methods on the notification objects. π Unfortunately this choice doesn't extend to diffs, which are configured using the global color configuration regardless, and are already saved into the failure message by the time the formatter comes to present them. π’
I'm not sure what the answer is here. At the moment I can probably use a clumsy regexp to grab the diff part of the message lines and clean it of ANSI codes, and will probably need to do so for current users. But perhaps there is an opportunity to parameterise the colorizer into the Differ as well through the ExceptionPresenter, or something? Perhaps they could even utilise the new
extra_failure_lines
somehow, if they had a way to consume a colorizer. If this sounds interesting I might try to give it a whack. π