-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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(android-studio): display app name as project name #1173
Conversation
For testing, I'd advise running You can also test locally by adding your custom platform by doing |
Oh! thanks again @breautek I was looking for that only to create a platform locally. |
Tried with Pardon my failing test cases, this is my first-time contribution to |
The tests uses fake paths cause they don't actually create files, they do this by mocking the real implementations of the filesystem. Looks like the tests will have to be updated. I'd probably would spy on Then ideally we will have some specific tests that will test the new |
Make sense. Most of the time (white writing JUnit test cases), my mind keep asking questions and then I used to reach to the same conclusion that the author of XYZ must have done their own testing 😄 Well, adding |
In jasmine, by default when you spy on a function, it will not call on the original implementation which is why it seemed to fix everything. I think this is okay since we don't need to test But we should have something like the following somewhere: describe('writeNameForAndroidStudio', () => {
it('should call ensureDirSync with path', () => {
spyOn(fs, 'ensureDirSync');
blah.writeNameForAndroidStudio(path); // Whatever what the interface is...
expect(fs.ensureDirSync).toHaveBeenCalledWith("thePathValue that is expected to have been passed into ensureDirSync");
});
it('should call wrilteFileSync', () => {
// basically the same for above but with writeFileSync instead.
});
}); That way the |
Thanks, @breautek for the guidance. That hint was more than sufficient to write the test cases :) |
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 is really good, also like that you added the comment explaining why we are adding that file, and the PR checks are green which is a good sign!
I just have a few nitpicks, namely the use of var
keyword and I'd prefer setting up the spies in a beforeEach
block since I think we'd want those two functions to be always spied on, even in potential future tests that may be added later.
Once these changes are committed, ping me and I'll give the PR a manual test.
Thanks for the appreciation!
Kudos to you for making it green.
Makes a lot of sense. I ❤️ doing nitpicks. Thanks for pointing this out.
It's done. By the time you will read this comment, yellow dots will be turned green and then you can test locally. Thanks again for your time. |
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.
Code LGTM
FYI: I edited the main post to include the GitHub Keyword so that the main issue ticket will be closed when we merge this in. |
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.
Ignore my message about things aren't working 😅 I retried the steps and it started working, I probably just accidentally used the wrong cordova-android fork the first time 😅
Thanks, no problem 😄 I was about to comment whether you have used the correct branch or not 😃 |
Thank you @sagrawal31 for your time and effort into preparing this PR. I hope we see more in the future. If you're not already, I invite you to our Slack community channel and our Dev Mailing List where you can stay up to date or contribute to development decisions. |
Thanks for your mentoring & guidance @breautek. Happy to contribute more. |
* (android) Feature: Write name of the Android app to .idea/.name for Android Studio apache#1172 * Missing space before function parentheses. * Add test for writeNameForAndroidStudio apache#1172 * Use ES6 for new code. Code DRYness in test spec. apache#1172
Platforms affected
Motivation and Context
Closes #1172
Testing
Tried locally but couldn't run (probably I have to read it more carefully).
Checklist
(platform)
if this change only applies to one platform (e.g.(android)
)