File tree Expand file tree Collapse file tree 2 files changed +27
-16
lines changed Expand file tree Collapse file tree 2 files changed +27
-16
lines changed Original file line number Diff line number Diff line change @@ -350,15 +350,11 @@ describe('electron:build', () => {
350
350
}
351
351
} )
352
352
expect ( fs . writeFileSync ) . toBeCalledWith (
353
- `dist_electron${ path . sep } bundled${
354
- path . sep
355
- } legacy-assets-index.html.json`,
353
+ `dist_electron${ path . sep } bundled${ path . sep } legacy-assets-index.html.json` ,
356
354
'[]'
357
355
)
358
356
expect ( fs . writeFileSync ) . toBeCalledWith (
359
- `dist_electron${ path . sep } bundled${
360
- path . sep
361
- } legacy-assets-subpage.html.json`,
357
+ `dist_electron${ path . sep } bundled${ path . sep } legacy-assets-subpage.html.json` ,
362
358
'[]'
363
359
)
364
360
}
@@ -386,6 +382,17 @@ describe('electron:build', () => {
386
382
} )
387
383
)
388
384
} )
385
+
386
+ test ( 'Config arguments overwrite config' , async ( ) => {
387
+ jest . unmock ( 'yargs' )
388
+ await runCommand ( 'electron:build' , undefined , undefined , [
389
+ '-c.directories.output=customDist'
390
+ ] )
391
+
392
+ expect ( builder . build . mock . calls [ 0 ] [ 0 ] . config . directories . output ) . toBe (
393
+ 'customDist'
394
+ )
395
+ } )
389
396
} )
390
397
391
398
describe ( 'electron:serve' , ( ) => {
Original file line number Diff line number Diff line change @@ -131,7 +131,9 @@ module.exports = (api, options) => {
131
131
try {
132
132
await api . service . run ( 'build' , vueArgs )
133
133
} catch ( e ) {
134
- error ( 'Vue CLI build failed. Please resolve any issues with your build and try again.' )
134
+ error (
135
+ 'Vue CLI build failed. Please resolve any issues with your build and try again.'
136
+ )
135
137
process . exit ( 1 )
136
138
}
137
139
// Copy package.json to output dir
@@ -207,15 +209,17 @@ module.exports = (api, options) => {
207
209
info ( 'Building app with electron-builder:' )
208
210
// Build the app using electron builder
209
211
builder
210
- . build ( {
211
- // Args parsed with yargs
212
- ...builderArgs ,
213
- config : merge (
214
- defaultBuildConfig ,
215
- // User-defined config overwrites defaults
216
- userBuildConfig
217
- )
218
- } )
212
+ . build (
213
+ merge ( {
214
+ config : merge (
215
+ defaultBuildConfig ,
216
+ // User-defined config overwrites defaults
217
+ userBuildConfig
218
+ ) ,
219
+ // Args parsed with yargs
220
+ ...builderArgs
221
+ } )
222
+ )
219
223
. then ( ( ) => {
220
224
// handle result
221
225
done ( 'Build complete!' )
You can’t perform that action at this time.
0 commit comments