You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2019/10/21 17:15:06 UTC

[cordova-node-xcode] branch master updated: Test coverage: `addTarget` add to main project as dependency (#76)

This is an automated email from the ASF dual-hosted git repository.

brodybits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-node-xcode.git


The following commit(s) were added to refs/heads/master by this push:
     new a80e27b  Test coverage: `addTarget` add to main project as dependency (#76)
a80e27b is described below

commit a80e27b539635e5eae916d778662dfd14fd74660
Author: l3ender <l3...@users.noreply.github.com>
AuthorDate: Mon Oct 21 12:14:58 2019 -0500

    Test coverage: `addTarget` add to main project as dependency (#76)
    
    * add coverage for main project target dependency
    
    * handle old env w/o support for object.entries
---
 test/addTarget.js | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/test/addTarget.js b/test/addTarget.js
index 452262c..61e61ee 100644
--- a/test/addTarget.js
+++ b/test/addTarget.js
@@ -123,6 +123,26 @@ exports.addTarget = {
 
         test.done();
     },
+    'should add target as a target dependency to the main target': function (test) {
+        var target = proj.addTarget(TARGET_NAME, TARGET_TYPE);
+        test.ok(target);
+        test.ok(target.uuid);
+
+        var pbxTargetDependencySection = proj.hash.project.objects['PBXTargetDependency'];
+
+        var targetDependencyUuid = Object.keys(pbxTargetDependencySection).find( (key) => pbxTargetDependencySection[key].target === target.uuid);
+        test.ok(targetDependencyUuid);
+
+        var firstTarget = proj.getFirstTarget();
+        test.ok(firstTarget);
+        test.ok(firstTarget.firstTarget);
+        test.ok(firstTarget.firstTarget.dependencies);
+
+        var firstTargetMatchingDependency = firstTarget.firstTarget.dependencies.find( (elem) => elem.value === targetDependencyUuid);
+        test.ok(firstTargetMatchingDependency);
+
+        test.done();
+    },
     'should have "wrapper.application" filetype for application product': function (test) {
         var target = proj.addTarget(TARGET_NAME, 'application');
         test.ok(target);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org