-
Notifications
You must be signed in to change notification settings - Fork 43
Handle testify errors when returned as a callstack #49
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
base: main
Are you sure you want to change the base?
Conversation
|
The tests are probably gonna fail for this PR. How do I run the tests? |
lua/neotest-go/init.lua
Outdated
| if file_id ~= nil then | ||
| -- when executing a function there may be no file_id | ||
| results[file_id].status = test_statuses.fail | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think file_id is always nil here? So I think that the if statement can be removed completely.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this value to be nil when executing a t.Run test function.
|
@sergii4 thanks for the tip. The tests pass and this is ready for review. |
|
Hi @zankich, sorry for late response. Could you please navigate me what issue this PR fixes? |
While taking a look at #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:
and
This PR fixes the nil exception and also returns the test diagnostics for failed tests using testify.