Skip to content

Commit 4c5c630

Browse files
l3enderChris Brody
authored andcommitted
Add proper filetypeForProducttype test coverage (#72)
* ensure filetypeForProducttype coverage * cleaner test target descriptions
1 parent 3588e16 commit 4c5c630

File tree

1 file changed

+130
-0
lines changed

1 file changed

+130
-0
lines changed

test/addTarget.js

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,136 @@ exports.addTarget = {
121121
var phases = proj.pbxCopyfilesBuildPhaseObj(target.uuid);
122122
test.ok(!phases);
123123

124+
test.done();
125+
},
126+
'should have "wrapper.application" filetype for application product': function (test) {
127+
var target = proj.addTarget(TARGET_NAME, 'application');
128+
test.ok(target);
129+
test.ok(target.pbxNativeTarget);
130+
test.ok(target.pbxNativeTarget.productReference);
131+
132+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
133+
test.ok(productFile);
134+
test.ok(productFile.explicitFileType);
135+
test.equal(productFile.explicitFileType, '"wrapper.application"');
136+
137+
test.done();
138+
},
139+
'should have "wrapper.app-extension" filetype for app_extension product': function (test) {
140+
var target = proj.addTarget(TARGET_NAME, 'app_extension');
141+
test.ok(target);
142+
test.ok(target.pbxNativeTarget);
143+
test.ok(target.pbxNativeTarget.productReference);
144+
145+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
146+
test.ok(productFile);
147+
test.ok(productFile.explicitFileType);
148+
test.equal(productFile.explicitFileType, '"wrapper.app-extension"');
149+
150+
test.done();
151+
},
152+
'should have "wrapper.plug-in" filetype for bundle product': function (test) {
153+
var target = proj.addTarget(TARGET_NAME, 'bundle');
154+
test.ok(target);
155+
test.ok(target.pbxNativeTarget);
156+
test.ok(target.pbxNativeTarget.productReference);
157+
158+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
159+
test.ok(productFile);
160+
test.ok(productFile.explicitFileType);
161+
test.equal(productFile.explicitFileType, '"wrapper.plug-in"');
162+
163+
test.done();
164+
},
165+
'should have "compiled.mach-o.dylib" filetype for command_line_tool product': function (test) {
166+
var target = proj.addTarget(TARGET_NAME, 'command_line_tool');
167+
test.ok(target);
168+
test.ok(target.pbxNativeTarget);
169+
test.ok(target.pbxNativeTarget.productReference);
170+
171+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
172+
test.ok(productFile);
173+
test.ok(productFile.explicitFileType);
174+
test.equal(productFile.explicitFileType, '"compiled.mach-o.dylib"');
175+
176+
test.done();
177+
},
178+
'should have "compiled.mach-o.dylib" filetype for dynamic_library product': function (test) {
179+
var target = proj.addTarget(TARGET_NAME, 'dynamic_library');
180+
test.ok(target);
181+
test.ok(target.pbxNativeTarget);
182+
test.ok(target.pbxNativeTarget.productReference);
183+
184+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
185+
test.ok(productFile);
186+
test.ok(productFile.explicitFileType);
187+
test.equal(productFile.explicitFileType, '"compiled.mach-o.dylib"');
188+
189+
test.done();
190+
},
191+
'should have "wrapper.framework" filetype for framework product': function (test) {
192+
var target = proj.addTarget(TARGET_NAME, 'framework');
193+
test.ok(target);
194+
test.ok(target.pbxNativeTarget);
195+
test.ok(target.pbxNativeTarget.productReference);
196+
197+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
198+
test.ok(productFile);
199+
test.ok(productFile.explicitFileType);
200+
test.equal(productFile.explicitFileType, '"wrapper.framework"');
201+
202+
test.done();
203+
},
204+
'should have "archive.ar" filetype for static_library product': function (test) {
205+
var target = proj.addTarget(TARGET_NAME, 'static_library');
206+
test.ok(target);
207+
test.ok(target.pbxNativeTarget);
208+
test.ok(target.pbxNativeTarget.productReference);
209+
210+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
211+
test.ok(productFile);
212+
test.ok(productFile.explicitFileType);
213+
test.equal(productFile.explicitFileType, '"archive.ar"');
214+
215+
test.done();
216+
},
217+
'should have "wrapper.cfbundle" filetype for unit_test_bundle product': function (test) {
218+
var target = proj.addTarget(TARGET_NAME, 'unit_test_bundle');
219+
test.ok(target);
220+
test.ok(target.pbxNativeTarget);
221+
test.ok(target.pbxNativeTarget.productReference);
222+
223+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
224+
test.ok(productFile);
225+
test.ok(productFile.explicitFileType);
226+
test.equal(productFile.explicitFileType, '"wrapper.cfbundle"');
227+
228+
test.done();
229+
},
230+
'should have "wrapper.application" filetype for watch_app product': function (test) {
231+
var target = proj.addTarget(TARGET_NAME, 'watch_app');
232+
test.ok(target);
233+
test.ok(target.pbxNativeTarget);
234+
test.ok(target.pbxNativeTarget.productReference);
235+
236+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
237+
test.ok(productFile);
238+
test.ok(productFile.explicitFileType);
239+
test.equal(productFile.explicitFileType, '"wrapper.application"');
240+
241+
test.done();
242+
},
243+
'should have "wrapper.app-extension" filetype for watch_extension product': function (test) {
244+
var target = proj.addTarget(TARGET_NAME, 'watch_extension');
245+
test.ok(target);
246+
test.ok(target.pbxNativeTarget);
247+
test.ok(target.pbxNativeTarget.productReference);
248+
249+
var productFile = proj.pbxFileReferenceSection()[target.pbxNativeTarget.productReference];
250+
test.ok(productFile);
251+
test.ok(productFile.explicitFileType);
252+
test.equal(productFile.explicitFileType, '"wrapper.app-extension"');
253+
124254
test.done();
125255
}
126256
}

0 commit comments

Comments
 (0)