apache/cordova-node-xcode

Internal filetypeForProducttype function not properly tested

Closed this issue · 2 comments

The following possible mutation would not be detected by the existing test suite:

diff --git a/lib/pbxProject.js b/lib/pbxProject.js
index 6466f47..c055e6a 100644
--- a/lib/pbxProject.js
+++ b/lib/pbxProject.js
@@ -1705,20 +1705,6 @@ function producttypeForTargettype (targetType) {
 
 function filetypeForProducttype (productType) {
 
-    FILETYPE_BY_PRODUCTTYPE = {
-            'com.apple.product-type.application': '"wrapper.application"',
-            'com.apple.product-type.app-extension': '"wrapper.app-extension"',
-            'com.apple.product-type.bundle': '"wrapper.plug-in"',
-            'com.apple.product-type.tool': '"compiled.mach-o.dylib"',
-            'com.apple.product-type.library.dynamic': '"compiled.mach-o.dylib"',
-            'com.apple.product-type.framework': '"wrapper.framework"',
-            'com.apple.product-type.library.static': '"archive.ar"',
-            'com.apple.product-type.bundle.unit-test': '"wrapper.cfbundle"',
-            'com.apple.product-type.application.watchapp': '"wrapper.application"',
-            'com.apple.product-type.watchkit-extension': '"wrapper.app-extension"'
-        };
-
-    return FILETYPE_BY_PRODUCTTYPE[productType]
 }
 
 pbxProject.prototype.getFirstProject = function() {

I think this test coverage should be added before we can finish adding WatchKit 2 as proposed in PR #56.

Mutation testing is done using Stryker as proposed in PR #61.

/cc @l3ender

I can take this up tomorrow (Friday) or this weekend.