testify icon indicating copy to clipboard operation
testify copied to clipboard

Color output

Open walles opened this issue 4 years ago • 6 comments

Summary

If TESTIFY_COLOR=true is in the environment, then expected and actual values will be coloured in green and red respectively.

Motivation

Stolen from #994:

  1. @boyan-soubachov says "It's an interesting idea."
  2. @mvdkleijn says "I like this idea."

Unlike #994, this PR is configured once for the whole run by setting an environment variable.

testicolor

Related issues

  • Closes #946
  • Related to #994

walles avatar Nov 23 '21 13:11 walles

@boyan-soubachov could you have a look at this?

walles avatar Dec 03 '21 08:12 walles

@alxn you had opinions on the sibling PR which should not be an issue with this one.

Do you think this one would work?

walles avatar Dec 13 '21 13:12 walles

Using an env-var to turn it on seems fine. At a later date someone can try to do the isatty check.

alxn avatar Dec 19 '21 22:12 alxn

Any updates?

vegerot avatar Mar 02 '22 01:03 vegerot

Any updates?

Not sure who you are asking here @vegerot, but the next step here is getting a review from some project maintainer.

Looking at the most recent merges, maintainers include:

  • @boyan-soubachov
  • @mvdkleijn

walles avatar Mar 02 '22 05:03 walles

While I understand the concerns about portability, file redirection, etc., it feels like all the other test runners I know (GoogleTest, Jest, Deno Test, ScalaTest, XCTest, etc.) all show colors when appropriate (jest does mess up sometimes when piping into other programs).

While I know this is a tricky problem to solve, it is definitely not intractable given these other frameworks

vegerot avatar Mar 02 '22 17:03 vegerot

I think leaving this open doesn't provide any value, closing.

Feel free to reopen if a reviewer becomes available!

walles avatar Sep 09 '22 11:09 walles