neotest-golang
Reliable Neotest adapter for running Go tests in Neovim.
Features
- Supports all Neotest usage.
- Supports table tests and nested test functions (based on treesitter AST parsing).
- DAP support. Either with leoluz/nvim-dap-go integration or custom configuration for debugging of tests using delve.
- Monorepo support (detect, run and debug tests in sub-projects).
- Inline diagnostics.
- Custom
go test
argument support. - Works great with andythigpen/nvim-coverage for displaying coverage in the sign column.
- Supports testify suites.
- Option to sanitize test output from non-UTF8 characters.
Documentation is available at https://fredrikaverpil.github.io/neotest-golang
Why a second Neotest adapter for Go? 🤔
While using neotest-go I stumbled upon many problems which seemed difficult to solve in that codebase.
I have full respect for the time and efforts put in by the developer(s) of neotest-go. I do not aim in any way to diminish their needs or efforts. However, I wanted to see if I could fix these issues by diving into the 🕳️🐇 of Neotest and building my own adapter. Below is a list of neotest-go issues which are not present in neotest-golang (this project):
Neotest-go issue | URL |
---|---|
Support for Testify framework | neotest-go#6 |
DAP support | neotest-go#12 |
Test Output in JSON, making it difficult to read | neotest-go#52 |
Support for Nested Subtests | neotest-go#74 |
Diagnostics for table tests on the line of failure | neotest-go#75 |
"Run nearest" runs all tests | neotest-go#83 |
Table tests not recognized when defined inside for-loop | neotest-go#86 |
Running test suite doesn't work | neotest-go#89 |
A comparison in number of GitHub stars between the projects: