-
Notifications
You must be signed in to change notification settings - Fork 125
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
Fix warning in generated server code #209
Conversation
Hey @czechboy0! I'm not sure where to add a proper test for this, do you have any idea how I could write a good test for this scenario? 🙂 |
Sure - using a snippet test would be ideal. But I'll have to create a new util function for it, let me push it directly into your branch, will let you know when it's ready. |
@arthurcro here you go: 2faf804 I created a test called |
That's aweomse @czechboy0, thank you so much! I'll add the missing test as soon as possible and mark the PR as ready! 🙂 |
d95b7ee
to
49b3115
Compare
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.
Great, thank you!
Motivation
Fixes #190.
Modifications
We fix the issue buy only generating this initializer if there's at least one operation. Otherwise keep the method empty.
Result
The warning is fixed since the
server
variable declaration is not added to theregisterHandlers
body when it's not used.Test Plan
We add a test in
SnippetBasedReferenceTests.swift
calledtestServerRegisterHandlers_noOperations
asserting theserver
variable delcaration is not added to theregisterHandlers
body.