Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proper filetypeForProducttype test coverage #72

Merged
merged 2 commits into from
Oct 18, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) {
l3ender marked this conversation as resolved.
Show resolved Hide resolved
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();
}
}