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);