-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Currently all our text output onto the console are in the console's default color:

We would like have the ability to output colored output. In particular, we want tests that pass to be output as green and failures to be red.
For example, In the top half of the screenshot where a ProgressFormatter is used, the character F should be output as red whereas the character . should be marked green. The whole paragraph including and after Failures: should also be in red. In the bottom half of the screenshot, the failure line 1 + 1 = 2 (FAILED) should be marked red.
This can be done through ANSI escape sequences for colors:
https://en.wikipedia.org/wiki/ANSI_escape_code#Colors
In a way similar to how RSpec did it with a ConsoleCode module under formatters:
https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/formatters/console_codes.rb
- create a very basic
ConsoleCodemodule that has a mapping between color codes and enums such asSUCCESSandFAILURE. - Modify ProgressFormatter to output successful test output as green and failure as red.
- Ditto for DocumentationFormatter.