You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When cucumber-js' STDERR or STDOUT is redirected to a file, there are still ANSI escapes in the output.
We should remove ANSI escapes when writing to a non-TTY stream.
One of the reasons we should do this is that the suggestion to redirect STDERR to a file in #1458 makes it difficult to read the contents written to that file:
�[32m�[1m┌──────────────────────────────────────────────────────────────────────────┐�[0m
�[32m�[1m│�[0m View your Cucumber Report at: �[32m�[1m│�[0m
�[32m�[1m│�[0m �[1m�[36m�[4mhttps://reports.cucumber.io/reports/59fbb8b0-a625-4f0e-8c5b-284b95387f03�[0m �[32m�[1m│�[0m
�[32m�[1m│�[0m �[32m�[1m│�[0m
�[32m�[1m│�[0m �[1mThis report will self-destruct in 24h.�[0m �[32m�[1m│�[0m
�[32m�[1m│�[0m Keep reports forever: �[4m�[1m�[36mhttps://reports.cucumber.io/profile�[0m �[32m�[1m│�[0m
�[32m�[1m└──────────────────────────────────────────────────────────────────────────┘�[0m
Since the ANSI escapes in this case come from the Cucumber Reports server (and not our own code), I suggest we implement this like this:
When
cucumber-js
'STDERR
orSTDOUT
is redirected to a file, there are still ANSI escapes in the output.We should remove ANSI escapes when writing to a non-TTY stream.
One of the reasons we should do this is that the suggestion to redirect
STDERR
to a file in #1458 makes it difficult to read the contents written to that file:Since the ANSI escapes in this case come from the Cucumber Reports server (and not our own code), I suggest we implement this like this:
See https://github.com/chalk/strip-ansi-stream
Also see #1050 which didn't really solve the problem of stripping ANSI - it just disallows using formatters that output ANSI.
The text was updated successfully, but these errors were encountered: