From d2db91c425c090fb6e39434c68946b30b2f44261 Mon Sep 17 00:00:00 2001 From: Ross Bender Date: Fri, 18 Oct 2019 07:48:05 -0500 Subject: [PATCH 1/2] ensure filetypeForProducttype coverage --- test/addTarget.js | 130 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/test/addTarget.js b/test/addTarget.js index 4eded2b..7af3731 100644 --- a/test/addTarget.js +++ b/test/addTarget.js @@ -121,6 +121,136 @@ exports.addTarget = { var phases = proj.pbxCopyfilesBuildPhaseObj(target.uuid); test.ok(!phases); + test.done(); + }, + 'should have \'wrapper.application\' filetype for application product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'application'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"wrapper.application"'); + + test.done(); + }, + 'should have \'wrapper.app-extension\' filetype for app_extension product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'app_extension'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"wrapper.app-extension"'); + + test.done(); + }, + 'should have \'wrapper.plug-in\' filetype for bundle product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'bundle'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"wrapper.plug-in"'); + + test.done(); + }, + 'should have \'compiled.mach-o.dylib\' filetype for command_line_tool product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'command_line_tool'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"compiled.mach-o.dylib"'); + + test.done(); + }, + 'should have \'compiled.mach-o.dylib\' filetype for dynamic_library product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'dynamic_library'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"compiled.mach-o.dylib"'); + + test.done(); + }, + 'should have \'wrapper.framework\' filetype for framework product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'framework'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"wrapper.framework"'); + + test.done(); + }, + 'should have \'archive.ar\' filetype for static_library product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'static_library'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"archive.ar"'); + + test.done(); + }, + 'should have \'wrapper.cfbundle\' filetype for unit_test_bundle product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'unit_test_bundle'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"wrapper.cfbundle"'); + + test.done(); + }, + 'should have \'wrapper.application\' filetype for watch_app product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'watch_app'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"wrapper.application"'); + + test.done(); + }, + 'should have \'wrapper.app-extension\' filetype for watch_extension product': function (test) { + var target = proj.addTarget(TARGET_NAME, 'watch_extension'); + test.ok(target); + test.ok(target.pbxNativeTarget); + test.ok(target.pbxNativeTarget.productReference); + + var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference]; + test.ok(productFile); + test.ok(productFile.explicitFileType); + test.equal(productFile.explicitFileType, '"wrapper.app-extension"'); + test.done(); } } From bf757cf5a1ea281571c833c154e5cf347d5e0006 Mon Sep 17 00:00:00 2001 From: Ross Bender Date: Fri, 18 Oct 2019 08:04:49 -0500 Subject: [PATCH 2/2] cleaner test target descriptions --- test/addTarget.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/addTarget.js b/test/addTarget.js index 7af3731..452262c 100644 --- a/test/addTarget.js +++ b/test/addTarget.js @@ -123,7 +123,7 @@ exports.addTarget = { test.done(); }, - 'should have \'wrapper.application\' filetype for application product': function (test) { + 'should have "wrapper.application" filetype for application product': function (test) { var target = proj.addTarget(TARGET_NAME, 'application'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -136,7 +136,7 @@ exports.addTarget = { test.done(); }, - 'should have \'wrapper.app-extension\' filetype for app_extension product': function (test) { + 'should have "wrapper.app-extension" filetype for app_extension product': function (test) { var target = proj.addTarget(TARGET_NAME, 'app_extension'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -149,7 +149,7 @@ exports.addTarget = { test.done(); }, - 'should have \'wrapper.plug-in\' filetype for bundle product': function (test) { + 'should have "wrapper.plug-in" filetype for bundle product': function (test) { var target = proj.addTarget(TARGET_NAME, 'bundle'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -162,7 +162,7 @@ exports.addTarget = { test.done(); }, - 'should have \'compiled.mach-o.dylib\' filetype for command_line_tool product': function (test) { + 'should have "compiled.mach-o.dylib" filetype for command_line_tool product': function (test) { var target = proj.addTarget(TARGET_NAME, 'command_line_tool'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -175,7 +175,7 @@ exports.addTarget = { test.done(); }, - 'should have \'compiled.mach-o.dylib\' filetype for dynamic_library product': function (test) { + 'should have "compiled.mach-o.dylib" filetype for dynamic_library product': function (test) { var target = proj.addTarget(TARGET_NAME, 'dynamic_library'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -188,7 +188,7 @@ exports.addTarget = { test.done(); }, - 'should have \'wrapper.framework\' filetype for framework product': function (test) { + 'should have "wrapper.framework" filetype for framework product': function (test) { var target = proj.addTarget(TARGET_NAME, 'framework'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -201,7 +201,7 @@ exports.addTarget = { test.done(); }, - 'should have \'archive.ar\' filetype for static_library product': function (test) { + 'should have "archive.ar" filetype for static_library product': function (test) { var target = proj.addTarget(TARGET_NAME, 'static_library'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -214,7 +214,7 @@ exports.addTarget = { test.done(); }, - 'should have \'wrapper.cfbundle\' filetype for unit_test_bundle product': function (test) { + 'should have "wrapper.cfbundle" filetype for unit_test_bundle product': function (test) { var target = proj.addTarget(TARGET_NAME, 'unit_test_bundle'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -227,7 +227,7 @@ exports.addTarget = { test.done(); }, - 'should have \'wrapper.application\' filetype for watch_app product': function (test) { + 'should have "wrapper.application" filetype for watch_app product': function (test) { var target = proj.addTarget(TARGET_NAME, 'watch_app'); test.ok(target); test.ok(target.pbxNativeTarget); @@ -240,7 +240,7 @@ exports.addTarget = { test.done(); }, - 'should have \'wrapper.app-extension\' filetype for watch_extension product': function (test) { + 'should have "wrapper.app-extension" filetype for watch_extension product': function (test) { var target = proj.addTarget(TARGET_NAME, 'watch_extension'); test.ok(target); test.ok(target.pbxNativeTarget);