lunarmodules / luassert

Assertion library for Lua
MIT License
202 stars 76 forks source link

How to output colors in a custom formatter? #175

Closed m00qek closed 2 years ago

m00qek commented 3 years ago

Hello everyone, thank you for maintaining luassert 🎆

I am trying to make a custom formatter that creates colored output. My first try was to append ANSI color codes to the final string and it worked as expected locally.

However, when running it on a github action it just prints the values of the codes (like \x1b[0m) instead of coloring the output. One interesting fact is that all other colors produced by luassert/busted are simply removed, which makes me think that there is way to at least detect and not output the colors.

How should my formatter output those colors?

Thank you!

** here is a run where this happens

Tieske commented 3 years ago

have a look at this Busted output handler: https://github.com/Olivine-Labs/busted/blob/master/busted/outputHandlers/utfTerminal.lua

Tieske commented 2 years ago

see this PR: https://github.com/Olivine-Labs/busted/pull/675

closing due to no response