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

feat: test output color #208

Merged

Conversation

jaymorelli96
Copy link
Contributor

Hi @fredrikaverpil this is what I came up with. I have also updated the documentation. This option is false by default.

I would like to add a screenshot of how it looks but it seems that I don't have access to the assets folder?

Also, I haven't included tests for this, not sure if it is expected for this?

Please let me know if it follows the conventions and it is idiomatic, as I said I don't have experience with Lua and plugin development. The changes are very small, so not sure if I can get much feedback from it 😄

Example of how it looks:
image

Copy link
Owner

@fredrikaverpil fredrikaverpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jaymorelli96 thank you for this, it looks and works really nice!
I especially like how the colors match up with the color scheme in use.

I also actually think we can make this the default, so I have given some suggestions on changes. 😄

Can you also just please add this into the options.lua:

https://github.com/fredrikaverpil/neotest-golang/blob/main/lua/neotest-golang/options.lua

local opts = {
  runner = "go", -- or "gotestsum"
  go_test_args = { "-v", "-race", "-count=1" }, -- NOTE: can also be a function
  gotestsum_args = { "--format=standard-verbose" }, -- NOTE: can also be a function
  go_list_args = {}, -- NOTE: can also be a function
  dap_go_opts = {}, -- NOTE: can also be a function
  testify_enabled = false,
+  colorize_test_output = true,
  warn_test_name_dupes = true,
  warn_test_not_executed = true,

  -- experimental, for now undocumented, options
  dev_notifications = false,
}

And also add colorize_test_output into the tests, so that they pass:

https://github.com/fredrikaverpil/neotest-golang/blob/e64292c12ab95c37ec21eaf33e21e8c5d56c8d29/tests/unit/options_spec.lua

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jaymorelli96
Copy link
Contributor Author

Cool, thanks @fredrikaverpil! Can you please take a look at the new changes?

Copy link
Owner

@fredrikaverpil fredrikaverpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!
Thank you! 🎉 😄

@fredrikaverpil fredrikaverpil merged commit 47ba93e into fredrikaverpil:main Oct 28, 2024
9 checks passed
This was referenced Oct 28, 2024
@jaymorelli96 jaymorelli96 deleted the feat/test-output-color branch October 28, 2024 17:45
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.

2 participants