Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stdout not matching the printed output - line length is different #1152

Open
kubaprzetakiewicz opened this issue Jun 14, 2023 · 1 comment
Open

Comments

@kubaprzetakiewicz
Copy link

Describe the bug

Running (npm|pnpm|yarn) -s betterer ci outputs a "pretty-printed" result, e.g.

   \ | /     _         _   _
 '-.ooo.-'  | |__  ___| |_| |_ ___ _ __ ___ _ __
---ooooo--- | '_ \/ _ \ __| __/ _ \ '__/ _ \ '__|
 .-'ooo'-.  | |_)|  __/ |_| ||  __/ | |  __/ |
   / | \    |_.__/\___|\__|\__\___|_|  \___|_|

🎉 Betterer: 6 tests done!
✅ Example test #1: "Example test #1" stayed the same. (2 issues) 😐
✅ Example test #2: "Example test #2" stayed the same. (2 issues) 😐
✅ Example test #3 - a longer label: "Example test #3 - a longer label" stayed the same. (9 issues) 😐
✅ Example test #4 - suuuuuuper long label to make a convincing point!: "Example test #4 - suuuuuuper long label to make a convincing point!" stayed the same. (7 issues) 😐
✅ #5: "#5" stayed the same. (2 issues) 😐
✅ This is #6: "This is #6" stayed the same. (3 issues) 😐

6 tests got checked. 🤔
6 tests stayed the same. 😐

but when the standard output is redirected to e.g. a file (i want to use it in CI for external reporting - Slack, PR comments, etc.) the output is different:

   \ | /     _         _   _
 '-.ooo.-'  | |__  ___| |_| |_ ___ _ __ ___ _ __
---ooooo--- | '_ \/ _ \ __| __/ _ \ '__/ _ \ '__|
 .-'ooo'-.  | |_)|  __/ |_| ||  __/ | |  __/ |
   / | \    |_.__/\___|\__|\__\___|_|  \___|_|

🎉 Betterer: 6 tests done!
✅ Example test #1: "Example test #1" stayed the same. (2 issues) 😐
✅ Example test #2: "Example test #2" stayed the same. (2 issues) 😐
✅ Example test #3 - a longer label: "Example test #3 - a longer label" stayed
the same. (9 issues) 😐
✅ Example test #4 - suuuuuuper long label to make a convincing point!: "Example
 test #4 - suuuuuuper long label to make a convincing point!" stayed the same.
(7 issues) 😐
✅ #5: "#5" stayed the same. (2 issues) 😐
✅ This is #6: "This is #6" stayed the same. (3 issues) 😐

6 tests got checked. 🤔
6 tests stayed the same. 😐

the lines are now wrapped which makes the output much less readable

To Reproduce

(npm|pnpm|yarn) -s betterer ci > output.txt
cat output.txt

Expected behavior
The redirected output would match the printed output

Versions:

OS
ProductName:		macOS
ProductVersion:		13.4
BuildVersion:		22F66
Betterer
5.4.0
Node
20.3.0
@kubaprzetakiewicz
Copy link
Author

i'm purposefully ignoring the repeated Betterer logo in the beginning - it's escaped with cursor codes, so it doesn't really matter in my case

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant