@@ -216,7 +216,8 @@ test.ifDevOrLinuxCi("extra metadata", () => {
216216 const extraMetadata = {
217217 foo : {
218218 bar : 12 ,
219- }
219+ } ,
220+ productName : "NewName"
220221 }
221222 return assertPack ( "test-app-one" , {
222223 targets : Platform . LINUX . createTarget ( DIR_TARGET ) ,
@@ -228,18 +229,53 @@ test.ifDevOrLinuxCi("extra metadata", () => {
228229 existingProp : 22 ,
229230 }
230231 } ) ,
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 ( {
233236 foo : {
234237 bar : 12 ,
235238 existingProp : 22 ,
236239 }
237240 } )
238- return BluebirdPromise . resolve ( )
239241 }
240242 } )
241243} )
242244
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+
243279test . ifOsx ( "app-executable-deps" , ( ) => {
244280 return assertPack ( "app-executable-deps" , {
245281 targets : Platform . current ( ) . createTarget ( DIR_TARGET ) ,
@@ -275,7 +311,7 @@ test.ifDevOrLinuxCi("smart unpack", () => {
275311 } )
276312} )
277313
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 .+ / ) )
279315
280316function allPlatforms ( dist : boolean = true ) : PackagerOptions {
281317 return {
0 commit comments