@@ -22,8 +22,8 @@ test.ifDevOrLinuxCi("ignore build resources", app({
22
22
projectDirCreated : projectDir => {
23
23
return outputFile ( path . join ( projectDir , "one/build/foo.txt" ) , "data" )
24
24
} ,
25
- packed : ( projectDir , outDir ) => {
26
- return assertThat ( path . join ( outDir , "linux" , "resources" , "app" , "one" , "build" , "foo.txt" ) ) . isFile ( )
25
+ packed : context => {
26
+ return assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app" , "one" , "build" , "foo.txt" ) ) . isFile ( )
27
27
} ,
28
28
} ) )
29
29
@@ -39,8 +39,8 @@ test.ifDevOrLinuxCi("files", app({
39
39
projectDirCreated : projectDir => {
40
40
return outputFile ( path . join ( projectDir , "ignoreMe" , "foo" ) , "data" )
41
41
} ,
42
- packed : ( projectDir , outDir ) => {
43
- return assertThat ( path . join ( outDir , "linux" , "resources" , "app" , "ignoreMe" ) ) . doesNotExist ( )
42
+ packed : context => {
43
+ return assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app" , "ignoreMe" ) ) . doesNotExist ( )
44
44
} ,
45
45
} ) )
46
46
@@ -60,10 +60,10 @@ test.ifDevOrLinuxCi("unpackDir one", app({
60
60
outputFile ( path . join ( projectDir , "b2" , "file" ) , "data" ) ,
61
61
] )
62
62
} ,
63
- packed : ( projectDir , outDir ) => {
63
+ packed : context => {
64
64
return BluebirdPromise . all ( [
65
- assertThat ( path . join ( outDir , "linux" , "resources" , "app.asar.unpacked" , "assets" ) ) . isDirectory ( ) ,
66
- assertThat ( path . join ( outDir , "linux" , "resources" , "app.asar.unpacked" , "b2" ) ) . isDirectory ( ) ,
65
+ assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app.asar.unpacked" , "assets" ) ) . isDirectory ( ) ,
66
+ assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app.asar.unpacked" , "b2" ) ) . isDirectory ( ) ,
67
67
] )
68
68
} ,
69
69
} ) )
@@ -85,10 +85,10 @@ test.ifDevOrLinuxCi("unpackDir", () => {
85
85
outputFile ( path . join ( projectDir , "app" , "b2" , "file" ) , "data" ) ,
86
86
] )
87
87
} ,
88
- packed : ( projectDir , outDir ) => {
88
+ packed : context => {
89
89
return BluebirdPromise . all ( [
90
- assertThat ( path . join ( outDir , "linux" , "resources" , "app.asar.unpacked" , "assets" ) ) . isDirectory ( ) ,
91
- assertThat ( path . join ( outDir , "linux" , "resources" , "app.asar.unpacked" , "b2" ) ) . isDirectory ( ) ,
90
+ assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app.asar.unpacked" , "assets" ) ) . isDirectory ( ) ,
91
+ assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app.asar.unpacked" , "b2" ) ) . isDirectory ( ) ,
92
92
] )
93
93
} ,
94
94
} )
@@ -120,10 +120,10 @@ test.ifNotCiOsx("ignore node_modules known dev dep", () => {
120
120
outputFile ( path . join ( projectDir , "ignoreMe" ) , "" ) ,
121
121
] )
122
122
} ,
123
- packed : ( projectDir , outDir ) => {
123
+ packed : context => {
124
124
return BluebirdPromise . all ( [
125
- assertThat ( path . join ( outDir , "linux" , "resources" , "app" , "node_modules" , "electron-osx-sign" ) ) . doesNotExist ( ) ,
126
- assertThat ( path . join ( outDir , "linux" , "resources" , "app" , "ignoreMe" ) ) . doesNotExist ( ) ,
125
+ assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app" , "node_modules" , "electron-osx-sign" ) ) . doesNotExist ( ) ,
126
+ assertThat ( path . join ( context . getResources ( Platform . LINUX ) , "app" , "ignoreMe" ) ) . doesNotExist ( ) ,
127
127
] )
128
128
} ,
129
129
} )
@@ -185,15 +185,12 @@ test("extraResources", async () => {
185
185
outputFile ( path . join ( projectDir , "ignoreMe.txt" ) , "ignoreMe" ) ,
186
186
] )
187
187
} ,
188
- packed : async ( projectDir , outDir ) => {
189
- const base = path . join ( outDir , platform . buildConfigurationKey )
188
+ packed : async context => {
189
+ const base = path . join ( context . outDir , platform . buildConfigurationKey + ` ${ platform === Platform . MAC ? "" : "-unpacked" } ` )
190
190
let resourcesDir = path . join ( base , "resources" )
191
191
if ( platform === Platform . MAC ) {
192
192
resourcesDir = path . join ( base , "TestApp.app" , "Contents" , "Resources" )
193
193
}
194
- else if ( platform === Platform . WINDOWS ) {
195
- resourcesDir = path . join ( base + "-unpacked" , "resources" )
196
- }
197
194
await assertThat ( path . join ( resourcesDir , "foo" ) ) . isDirectory ( )
198
195
await assertThat ( path . join ( resourcesDir , "foo" , "nameWithoutDot" ) ) . isFile ( )
199
196
await assertThat ( path . join ( resourcesDir , "bar" , "hello.txt" ) ) . isFile ( )
@@ -258,15 +255,12 @@ test("extraResources - one-package", async () => {
258
255
outputFile ( path . join ( projectDir , "ignoreMe.txt" ) , "ignoreMe" ) ,
259
256
] )
260
257
} ,
261
- packed : async ( projectDir , outDir ) => {
262
- const base = path . join ( outDir , platform . buildConfigurationKey )
258
+ packed : async context => {
259
+ const base = path . join ( context . outDir , platform . buildConfigurationKey + ` ${ platform === Platform . MAC ? "" : "-unpacked" } ` )
263
260
let resourcesDir = path . join ( base , "resources" )
264
261
if ( platform === Platform . MAC ) {
265
262
resourcesDir = path . join ( base , "TestApp.app" , "Contents" , "Resources" )
266
263
}
267
- else if ( platform === Platform . WINDOWS ) {
268
- resourcesDir = path . join ( base + "-unpacked" , "resources" )
269
- }
270
264
const appDir = path . join ( resourcesDir , "app" )
271
265
272
266
await assertThat ( path . join ( resourcesDir , "foo" ) ) . isDirectory ( )
0 commit comments