Skip to content

Commit

Permalink
Test coverage: addTarget add to main project as dependency (#76)
Browse files Browse the repository at this point in the history
* add coverage for main project target dependency

* handle old env w/o support for object.entries
  • Loading branch information
l3ender authored and Chris Brody committed Oct 21, 2019
1 parent bd85d9a commit a80e27b
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/addTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a80e27b

Please sign in to comment.