-
-
Notifications
You must be signed in to change notification settings - Fork 148
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: skipDoubleRegistration configuration #356
Conversation
But why not simply setting allowReasignment== true? why a new property? what do I miss here? |
OK, I now understood the goal. We should name it |
Also please also add it to the readme |
Okay I will do changes as requested Thanks for the response |
@escamoteur changes are done as you suggested. |
9d1a317
to
df3a12e
Compare
@escamoteur can you review this changes and merge, if there is no code review comments. |
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.
Awesome work
This PR is the implementation for feature request #335
Use case :
Some times developer don't want to touch production code to write test cases.
Scenario :
Code was release to production but some test cases are not written due to some high priorities.
if developer want to write test cases after some time, Then some test mock implementations need to put in place of real implementations.
To do this developer need to add if-else cases in production code to place right dependencies for test environments.
I feel touching production code after release, just for writing extra test cases is not a good approach.
Currently get_it does not have a capability to skip registrations if already registered. it throws Argument Error
Here is the test case which throws Argument Error
This PR adds one boolean variable
skipDoubleRegistration
to get_it configuration to ignore registration silently.Here is the test case:
To understand more, i have implemented a real world use case in a sample git repo, look into source code
I am open to take feedback and happy to modify this PR to land this feature requirement into get_it package.