@@ -71,7 +71,7 @@ console.log = jest.fn()
7171beforeEach ( ( ) => {
7272 jest . clearAllMocks ( )
7373} )
74- chokidar . watch . mockImplementation ( file => {
74+ chokidar . watch . mockImplementation ( ( file ) => {
7575 return {
7676 on : ( type , cb ) => { }
7777 }
@@ -84,14 +84,14 @@ const runCommand = async (command, options = {}, args = {}, rawArgs = []) => {
8484 if ( ! args . _ ) args . _ = [ ]
8585 const commands = { }
8686 const api = {
87- // Make app think typescript plugin is installed
87+ // Make app think typescript plugin is installed
8888 hasPlugin : jest . fn ( ) . mockReturnValue ( true ) ,
8989 registerCommand : jest . fn ( ) . mockImplementation ( ( name , options , command ) => {
9090 // Save registered commands
9191 commands [ name ] = command
9292 } ) ,
9393 // So we can ensure that files were resolved properly
94- resolve : jest . fn ( path => 'projectPath/' + path ) ,
94+ resolve : jest . fn ( ( path ) => 'projectPath/' + path ) ,
9595 chainWebpack : jest . fn ( ) ,
9696 service : {
9797 // Mock api.service.run('build/serve')
@@ -120,13 +120,13 @@ describe('electron:build', () => {
120120 } )
121121
122122 const mainConfig = webpack . mock . calls [ 0 ] [ 0 ]
123- // Typescript rule is not added
123+ // Typescript rule is not added
124124 expect ( Object . keys ( mainConfig ) ) . not . toContain ( 'module' )
125- // Ts files are not resolved
125+ // Ts files are not resolved
126126 expect (
127127 mainConfig . resolve . extensions ? mainConfig . resolve . extensions : [ ]
128128 ) . not . toContain ( 'ts' )
129- // Proper entry file is used
129+ // Proper entry file is used
130130 expect ( mainConfig . entry . background [ 0 ] ) . toBe ( 'projectPath/src/background.js' )
131131 } )
132132
@@ -140,7 +140,7 @@ describe('electron:build', () => {
140140 } )
141141
142142 const mainConfig = webpack . mock . calls [ 0 ] [ 0 ]
143- // Proper entry file is used
143+ // Proper entry file is used
144144 expect ( mainConfig . entry . background [ 0 ] ) . toBe (
145145 'projectPath/customBackground.js'
146146 )
@@ -156,11 +156,11 @@ describe('electron:build', () => {
156156 } )
157157
158158 const mainConfig = webpack . mock . calls [ 0 ] [ 0 ]
159- // Main config output is correct
159+ // Main config output is correct
160160 expect ( mainConfig . output . path ) . toBe ( 'projectPath/output/bundled' )
161161 // cli-service build output is correct
162162 expect ( serviceRun . mock . calls [ 0 ] [ 1 ] . dest ) . toBe ( `output${ path . sep } bundled` )
163- // Electron-builder output is correct
163+ // Electron-builder output is correct
164164 expect ( builder . build . mock . calls [ 0 ] [ 0 ] . config . directories . output ) . toBe (
165165 'output'
166166 )
@@ -170,11 +170,11 @@ describe('electron:build', () => {
170170 await runCommand ( 'electron:build' , { } , { dest : 'output' } )
171171
172172 const mainConfig = webpack . mock . calls [ 0 ] [ 0 ]
173- // Main config output is correct
173+ // Main config output is correct
174174 expect ( mainConfig . output . path ) . toBe ( 'projectPath/output/bundled' )
175175 // cli-service build output is correct
176176 expect ( serviceRun . mock . calls [ 0 ] [ 1 ] . dest ) . toBe ( `output${ path . sep } bundled` )
177- // Electron-builder output is correct
177+ // Electron-builder output is correct
178178 expect ( builder . build . mock . calls [ 0 ] [ 0 ] . config . directories . output ) . toBe (
179179 'output'
180180 )
@@ -184,7 +184,7 @@ describe('electron:build', () => {
184184 await runCommand ( 'electron:build' , {
185185 pluginOptions : {
186186 electronBuilder : {
187- chainWebpackMainProcess : config => {
187+ chainWebpackMainProcess : ( config ) => {
188188 config . node . set ( 'shouldBe' , 'expected' )
189189 return config
190190 }
@@ -269,7 +269,7 @@ describe('electron:build', () => {
269269
270270 test . each ( [ 'report' , 'report-json' ] ) (
271271 '--%s arg is passed to renderer build' ,
272- async argName => {
272+ async ( argName ) => {
273273 const args = { }
274274 args [ argName ] = true
275275 await runCommand ( 'electron:build' , { } , args )
@@ -339,7 +339,7 @@ describe('electron:build', () => {
339339
340340 test . each ( [ 'string config' , 'object config' ] ) (
341341 'Adds mock legacy assets file for each page (%s)' ,
342- async configType => {
342+ async ( configType ) => {
343343 const stringConfig = configType === 'string config'
344344 await runCommand ( 'electron:build' , {
345345 pages : {
@@ -408,7 +408,9 @@ describe('electron:build', () => {
408408 expect ( webpack ) . toBeCalledTimes ( 2 )
409409 const preloadWebpackCall = webpack . mock . calls [ 1 ] [ 0 ]
410410 expect ( preloadWebpackCall . target ) . toBe ( 'electron-preload' )
411- expect ( preloadWebpackCall . entry ) . toEqual ( { preload : [ 'projectPath/preloadFile' ] } )
411+ expect ( preloadWebpackCall . entry ) . toEqual ( {
412+ preload : [ 'projectPath/preloadFile' ]
413+ } )
412414 // Make sure preload bundle has been run
413415 expect ( mockRun ) . toHaveBeenCalledTimes ( 2 )
414416 webpack . mockClear ( )
@@ -454,13 +456,13 @@ describe('electron:serve', () => {
454456 } )
455457
456458 const mainConfig = webpack . mock . calls [ 0 ] [ 0 ]
457- // Typescript rule is not added
459+ // Typescript rule is not added
458460 expect ( Object . keys ( mainConfig ) ) . not . toContain ( 'module' )
459- // Ts files are not resolved
461+ // Ts files are not resolved
460462 expect (
461463 mainConfig . resolve . extensions ? mainConfig . resolve . extensions : [ ]
462464 ) . not . toContain ( 'ts' )
463- // Proper entry file is used
465+ // Proper entry file is used
464466 expect ( mainConfig . entry . index [ 0 ] ) . toBe ( 'projectPath/src/background.js' )
465467 } )
466468
@@ -474,7 +476,7 @@ describe('electron:serve', () => {
474476 } )
475477
476478 const mainConfig = webpack . mock . calls [ 0 ] [ 0 ]
477- // Proper entry file is used
479+ // Proper entry file is used
478480 expect ( mainConfig . entry . index [ 0 ] ) . toBe ( 'projectPath/customBackground.js' )
479481 } )
480482
@@ -488,15 +490,15 @@ describe('electron:serve', () => {
488490 } )
489491
490492 const mainConfig = webpack . mock . calls [ 0 ] [ 0 ]
491- // Main config output is correct
493+ // Main config output is correct
492494 expect ( mainConfig . output . path ) . toBe ( 'projectPath/output' )
493495 } )
494496
495497 test ( 'Custom main process webpack config is used if provided' , async ( ) => {
496498 await runCommand ( 'electron:serve' , {
497499 pluginOptions : {
498500 electronBuilder : {
499- chainWebpackMainProcess : config => {
501+ chainWebpackMainProcess : ( config ) => {
500502 config . node . set ( 'shouldBe' , 'expected' )
501503 return config
502504 }
@@ -565,7 +567,7 @@ describe('electron:serve', () => {
565567 // UglifyJS plugin does not exist
566568 expect (
567569 mainConfig . plugins . find (
568- p => p . __pluginConstructorName === 'UglifyJsPlugin'
570+ ( p ) => p . __pluginConstructorName === 'UglifyJsPlugin'
569571 )
570572 ) . toBeUndefined ( )
571573 // Source maps are enabled
@@ -604,7 +606,9 @@ describe('electron:serve', () => {
604606 } )
605607
606608 // Proper file is watched
607- expect ( chokidar . watch . mock . calls [ 0 ] [ 0 ] ) . toEqual ( [ 'projectPath/customBackground' ] )
609+ expect ( chokidar . watch . mock . calls [ 0 ] [ 0 ] ) . toEqual ( [
610+ 'projectPath/customBackground'
611+ ] )
608612 // Child has not yet been killed or unwatched
609613 expect ( mockExeca . send ) . not . toBeCalled ( )
610614 expect ( mockExeca . kill ) . not . toBeCalled ( )
@@ -643,10 +647,10 @@ describe('electron:serve', () => {
643647 // So we can make sure it wasn't called
644648 jest . spyOn ( process , 'exit' )
645649 const watchCb = { }
646- chokidar . watch . mockImplementation ( files => {
650+ chokidar . watch . mockImplementation ( ( files ) => {
647651 return {
648652 on : ( type , cb ) => {
649- files . forEach ( file => {
653+ files . forEach ( ( file ) => {
650654 // Set callback to be called later
651655 watchCb [ file ] = cb
652656 } )
@@ -665,7 +669,10 @@ describe('electron:serve', () => {
665669 } )
666670
667671 // Proper file is watched
668- expect ( chokidar . watch . mock . calls [ 0 ] [ 0 ] ) . toEqual ( [ 'projectPath/customBackground' , 'projectPath/listFile' ] )
672+ expect ( chokidar . watch . mock . calls [ 0 ] [ 0 ] ) . toEqual ( [
673+ 'projectPath/customBackground' ,
674+ 'projectPath/listFile'
675+ ] )
669676 // Child has not yet been killed or unwatched
670677 expect ( mockExeca . send ) . not . toBeCalled ( )
671678 expect ( mockExeca . kill ) . not . toBeCalled ( )
@@ -864,7 +871,9 @@ describe('electron:serve', () => {
864871 expect ( webpack ) . toBeCalledTimes ( 2 )
865872 const preloadWebpackCall = webpack . mock . calls [ 1 ] [ 0 ]
866873 expect ( preloadWebpackCall . target ) . toBe ( 'electron-preload' )
867- expect ( preloadWebpackCall . entry ) . toEqual ( { preload : [ 'projectPath/preloadFile' ] } )
874+ expect ( preloadWebpackCall . entry ) . toEqual ( {
875+ preload : [ 'projectPath/preloadFile' ]
876+ } )
868877 // Make sure preload bundle has been run
869878 expect ( mockRun ) . toHaveBeenCalledTimes ( 2 )
870879 webpack . mockClear ( )
0 commit comments