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

test(tree): use golden file to preserve ANSI sequences #476

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bashbunni
Copy link
Member

@bashbunni bashbunni commented Feb 14, 2025

This might be a "fix" rather than "test" conventional commit, but this fixes a test that is broken on master. Not sure if/how this ever passed since it was giving a styled output despite the want value not being styled. This change uses a golden file to track the style changes (resulting ANSI sequences) in the test output.

Didn't work on v1.0.0 either 🤷

@bashbunni
Copy link
Member Author

bashbunni commented Feb 14, 2025

Oh right, it's because the terminal used for GitHub actions doesn't have colour capability, so the test was passing with GitHub actions and failing locally... Now this fails CI 😂 We can either add lipgloss.SetColorProfile(termenv.TrueColor) at the beginning of this test to force coloured output in GH actions or not use a golden file and compare want to ansi.Strip(table.String()) and ignore the colours in the test

Edit: in v2 we won't need to force colorprofile in the tests

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

Successfully merging this pull request may close these issues.

3 participants