Skip to content

Commit

Permalink
Add proper filetypeForProducttype test coverage (#72)
Browse files Browse the repository at this point in the history
* ensure filetypeForProducttype coverage

* cleaner test target descriptions
  • Loading branch information
l3ender authored and Chris Brody committed Oct 18, 2019
1 parent 3588e16 commit 4c5c630
Showing 1 changed file with 130 additions and 0 deletions.
130 changes: 130 additions & 0 deletions test/addTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

0 comments on commit 4c5c630

Please sign in to comment.