@@ -216,7 +216,8 @@ test.ifDevOrLinuxCi("extra metadata", () => {
216
216
const extraMetadata = {
217
217
foo : {
218
218
bar : 12 ,
219
- }
219
+ } ,
220
+ productName : "NewName"
220
221
}
221
222
return assertPack ( "test-app-one" , {
222
223
targets : Platform . LINUX . createTarget ( DIR_TARGET ) ,
@@ -228,18 +229,53 @@ test.ifDevOrLinuxCi("extra metadata", () => {
228
229
existingProp : 22 ,
229
230
}
230
231
} ) ,
231
- packed : projectDir => {
232
- assertThat ( JSON . parse ( extractFile ( path . join ( projectDir , "dist" , "linux" , "resources" , "app.asar" ) , "package.json" ) . toString ( ) ) ) . hasProperties ( {
232
+ packed : async ( projectDir ) => {
233
+ const out = path . join ( projectDir , "dist" , "linux" )
234
+ await assertThat ( path . join ( out , "NewName" ) ) . isFile ( )
235
+ assertThat ( JSON . parse ( extractFile ( path . join ( out , "resources" , "app.asar" ) , "package.json" ) . toString ( ) ) ) . hasProperties ( {
233
236
foo : {
234
237
bar : 12 ,
235
238
existingProp : 22 ,
236
239
}
237
240
} )
238
- return BluebirdPromise . resolve ( )
239
241
}
240
242
} )
241
243
} )
242
244
245
+ test . ifDevOrLinuxCi ( "extra metadata - two" , ( ) => {
246
+ const extraMetadata = {
247
+ productName : "NewName"
248
+ }
249
+ return assertPack ( "test-app" , {
250
+ targets : Platform . LINUX . createTarget ( DIR_TARGET ) ,
251
+ extraMetadata : extraMetadata ,
252
+ } , {
253
+ packed : async ( projectDir ) => {
254
+ const out = path . join ( projectDir , "dist" , "linux" )
255
+ await assertThat ( path . join ( out , "NewName" ) ) . isFile ( )
256
+ }
257
+ } )
258
+ } )
259
+
260
+ test . ifOsx ( "extra metadata - override icon" , t => t . throws ( ( ( ) => {
261
+ const extraMetadata = {
262
+ build : {
263
+ mac : {
264
+ icon : "dev"
265
+ }
266
+ } ,
267
+ }
268
+ return assertPack ( "test-app" , {
269
+ targets : Platform . OSX . createTarget ( DIR_TARGET ) ,
270
+ extraMetadata : extraMetadata ,
271
+ } , {
272
+ packed : async ( projectDir ) => {
273
+ const out = path . join ( projectDir , "dist" , "linux" )
274
+ await assertThat ( path . join ( out , "NewName" ) ) . isFile ( )
275
+ }
276
+ } )
277
+ } ) ( ) , / E N O E N T : n o s u c h f i l e o r d i r e c t o r y / ) )
278
+
243
279
test . ifOsx ( "app-executable-deps" , ( ) => {
244
280
return assertPack ( "app-executable-deps" , {
245
281
targets : Platform . current ( ) . createTarget ( DIR_TARGET ) ,
@@ -275,7 +311,7 @@ test.ifDevOrLinuxCi("smart unpack", () => {
275
311
} )
276
312
} )
277
313
278
- test . ifWinCi ( "Build MacOS on Windows is not supported" , ( t : any ) => t . throws ( assertPack ( "test-app-one" , platform ( Platform . MAC ) ) , / B u i l d f o r M a c O S i s s u p p o r t e d o n l y o n M a c O S .+ / ) )
314
+ test . ifWinCi ( "Build MacOS on Windows is not supported" , t => t . throws ( assertPack ( "test-app-one" , platform ( Platform . MAC ) ) , / B u i l d f o r M a c O S i s s u p p o r t e d o n l y o n M a c O S .+ / ) )
279
315
280
316
function allPlatforms ( dist : boolean = true ) : PackagerOptions {
281
317
return {
0 commit comments