-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat: Global mode to choose only to mock registered routes #84
Conversation
…d routes, and let every other url to be processed as if the Mocker is not present.
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.
Thanks a lot for your contribution. For a first timer it looks really great!
I've added some comments. Can you fix those?
Also, can you write tests for both modes to make sure they work as expected?
Thanks!
I've fixed what you told me to, and I added unit tests. Hope it's ok! |
Mocker.framework: Coverage: 0.0
MockerTests.xctest: Coverage: 0.0
Generated by 🚫 Danger Swift against 0a7b306 |
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.
This looks great, thanks a lot!
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.
Oh, one last thing! Would you mind adding a little chapter in the readme to describe this functionality? It would make your work more visible to others 🙂
Sorry for those oversights, it's fixed! |
Hello @AvdLee, if the MR is approved, do you have any release date in mind? |
@letatas I'll do that now! 🙂 |
Congratulations! 🎉 This was released as part of Release 2.5.0 🚀 Generated by GitBuddy |
Great! Thanks for this new release! |
@AvdLee It seems the |
@letatas just some feedback, the tests turned out to fail. I'm fixing that now but for future PRs, do check whether all other tests succeed too by running the complete test bundle 🙂 Thanks! |
Also, I'm going to make sure Cocoapods is up to date after #86 is merged in |
@AvdLee Sorry for the tests, as some tests didn't pass when I forked, even before I changes anything, I thought it was due to my local configuration. I'll be more cautious next time. |
Ah, if that was the case it makes total sense. Thanks, it's all running smooth again! 🙂 |
Great! Thanks. One more thing, though: when I try to install Mocker with Cocoapods, it seems to be stalled in v2.2.0, there's no hint of v2.5 or v2.5.1.
Any thoughts? |
@letatas it seems that our pod release train is currently broken:
Feel free to have a look at it but at this point, we don't have time to work on this. You can integrate Mocker through SPM as an alternative. |
Hello,
This is my first time contribution ever.
Yesterday I wrote a question / feature request for our needs: #83
After checking out the source, I found an easy way to integrate this feature without changing the current way it works. So I propose a Pull request to integrate it.
This feature adds a new property to the
Mocker
struct calledmode
. By default the current mode is.optout
meaning you have to manually define all the routes you want the system to ignore and thus to process as if the mocker does not exist. This is the way it works today. The other mode is.optin
used to let all the routes being processed as if there were no mocking system, except for the mocked routes.The use case leading to this feature is when you have an existing API with many routes, and a team has to develop a new route, for your development phase, you can mock only this route, to keep using you app and all the other routes in a complete transparent way.
I hope you'll find this useful.