nvim-neotest / neotest-go

MIT License
124 stars 43 forks source link

Handle testify errors when returned as a callstack #49

Open zankich opened 1 year ago

zankich commented 1 year ago

While taking a look at https://github.com/nvim-neotest/neotest-go/issues/47 I noticed that the testify output wasn't correctly being parsed which may have contributed to the nil reference error.

Testify will reports errors with the format:

Error Trace:    /my-package/my_test.go:49

and

at: [/some-package/file.go:104 /my-package/my_test.go:933]\n

This PR fixes the nil exception and also returns the test diagnostics for failed tests using testify.

zankich commented 1 year ago

The tests are probably gonna fail for this PR. How do I run the tests?

sergii4 commented 1 year ago

Hi @zankich, to run test you need plenary installed then map:

nmap <leader>t <Plug>PlenaryTestFile

and finally use that mapping when you are in test(spec) file

zankich commented 1 year ago

@sergii4 thanks for the tip. The tests pass and this is ready for review.

sergii4 commented 1 year ago

Hi @zankich, sorry for late response. Could you please navigate me what issue this PR fixes?