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

Adds useful message when test panics on no return values #736

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

mateusmarquezini
Copy link
Contributor

Description

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Version of Golang used when building/testing:

  • 1.11
  • 1.12
  • 1.13
  • 1.14
  • 1.15
  • 1.16
  • 1.17
  • 1.18
  • 1.19
  • 1.20

How Has This Been Tested?

I tested by using Unit tests

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@mateusmarquezini mateusmarquezini changed the title added new check for no return values Adds useful message when test panics on no return values Nov 20, 2023
pkg/generator_test.go Outdated Show resolved Hide resolved
@mateusmarquezini mateusmarquezini marked this pull request as ready for review November 20, 2023 20:27
pkg/generator.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c7a65e2) 75.25042% compared to head (d0fa1f9) 75.16639%.

Additional details and impacted files
@@                 Coverage Diff                 @@
##              master        #736         +/-   ##
===================================================
- Coverage   75.25042%   75.16639%   -0.08403%     
===================================================
  Files              9          10          +1     
  Lines           2396        2404          +8     
===================================================
+ Hits            1803        1807          +4     
- Misses           455         459          +4     
  Partials         138         138                 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@LandonTClipp LandonTClipp left a comment

Choose a reason for hiding this comment

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

This looks great. I'll approve for now and give it one last look later today and merge once the tests pass (coverage might fail but I'm going to remove that check, it's not entirely useful). Thanks for the contribution ❤️

@mateusmarquezini
Copy link
Contributor Author

Awesome! Thanks for your patience and support @LandonTClipp!

@LandonTClipp LandonTClipp merged commit 446e0bf into vektra:master Nov 21, 2023
4 of 5 checks passed
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.

Omitting .Return() on an expectation results in a panic and a stack trace rather than a useful error message
2 participants