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

Unit tests for android_sdk and AndroidProject #464

Merged
merged 3 commits into from
Sep 2, 2018

Conversation

Menardi
Copy link
Contributor

@Menardi Menardi commented Jul 3, 2018

Platforms affected

Android

What does this PR do?

This is the last unit test PR for today, I promise! The AndroidProject tests were originally in #458. This PR also contains increased test coverage for android_sdk.js. I have also refactored that to remove Q, as with the other PRs I submitted today.

What testing has been done on this change?

Run unit tests

Checklist

  • Reported an issue in the JIRA database
  • Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
  • Added automated test coverage as appropriate for this change.

@codecov-io
Copy link

Codecov Report

Merging #464 into master will increase coverage by 0.56%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #464      +/-   ##
==========================================
+ Coverage   52.03%   52.59%   +0.56%     
==========================================
  Files          17       17              
  Lines        1695     1694       -1     
  Branches      312      312              
==========================================
+ Hits          882      891       +9     
+ Misses        813      803      -10
Impacted Files Coverage Δ
bin/templates/cordova/lib/android_sdk.js 100% <100%> (+26.47%) ⬆️
bin/templates/cordova/lib/AndroidProject.js 43.47% <0%> (+0.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca8931c...64aef32. Read the comment docs.

@@ -95,7 +94,7 @@ module.exports.list_targets = function () {
} else throw err;
}).then(function (targets) {
if (targets.length === 0) {
return Q.reject(new Error('No android targets (SDKs) installed!'));
return Promise.reject(new Error('No android targets (SDKs) installed!'));
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer to simply throw the Errors instead of wrapping them in a rejection and returning them. Might be personal taste though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have no strong feelings either way. But, when replacing Q, I wanted to keep the changes as simple as possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough

@janpio janpio merged commit 7ab0cf1 into apache:master Sep 2, 2018
@Menardi Menardi deleted the more_tests branch September 4, 2018 07:30
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.

5 participants