nette / tester

Tester: enjoyable unit testing in PHP with code coverage reporter. 🍏🍏🍎🍏
https://tester.nette.org
Other
453 stars 71 forks source link

Composer run-scripts ommit tester colors #343

Closed f3l1x closed 7 years ago

f3l1x commented 7 years ago

I do not know if it's bug or it's a feature. :question:

composer run-script nette-tester strips colors in output. On the other hand composer run-script codesniffer does not.

Name of the scripts are fake, just for demonstration.


CodeSniffer: https://travis-ci.org/contributte/logging/jobs/181436162#L222

selection_001

NetteTester: https://travis-ci.org/contributte/logging/jobs/181436162#L244

Sections shoud be green.

selection_002

JanTvrdik commented 7 years ago

detecting support for colors always was and likely always will be magic

milo commented 7 years ago

Tester detects if STDOUT is a terminal. If not, colors are disabled.

First guess... phpcs ignores it. Second guess... composer uses probably symfony EventDispatcher and it somehow redirects stdout, so stdout is not a terminal.

Maybe I'm wrong, I don't know mentioned tools source.

You can add --colors for tester to force colors usage.

f3l1x commented 7 years ago

Command tester --colors works like a charm! Thank you.