Benjamin Schneider
Benjamin Schneider

Reputation: 57

Minitest console output does not show colors

I installed ansicon to make ansi colorized console output possible for minitest test feedback on windows.

I am running minitest with the minitest-reporters gem to format the output, yet whatever I do I can't get the output to show colors (all text is black).

Here's my test_helper.rb file:

ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/reporters"
Minitest::Reporters.use! Minitest::Reporters::ProgressReporter.new( { :color     => true } )

class ActiveSupport::TestCase
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end

Does anyone know this problem?

Upvotes: 3

Views: 1685

Answers (1)

Askar
Askar

Reputation: 5854

Reference: https://github.com/kern/minitest-reporters

I see the post is from 2015. 4 years passed since then. Anyway, let me share how it worked for me yesterday.

My environment:

  • Ubuntu 18.04
  • rails 6.0.1
  • ruby 2.6.5

1) Gemfile:

gem 'minitest-reporters'

2) bundle install

3) test_helper.rb:

require "minitest/reporters"
Minitest::Reporters.use!

4) rake

enter image description here

Upvotes: 6

Related Questions