@@ -52,41 +52,36 @@ module.exports = () => {
52
52
} ) ;
53
53
54
54
test . beforeEach ( async ( ) => {
55
- try {
56
- console . info ( '[beforeEach] starting beforeEach' ) ;
57
- // Reset console errors at the start of each test
58
- logs = [ ] ;
59
-
60
- // Pass in --test-mode for headless testing
61
- electronApp = await electron . launch ( {
62
- timeout : 120000 ,
63
- cwd : exeDir ,
64
- args : [ appInfo . main , '--disable-http-cache' , '--fl-test-mode' ] ,
65
- executablePath : appInfo . executable // Path to the Electron executable
66
- } ) ;
67
- console . info ( '[beforeEach] launched electronApp' ) ;
68
-
69
- await electronApp . evaluate ( async ( { session } ) => await session . defaultSession . clearCache ( ) ) ;
70
-
71
- // Log main process
72
- electronApp . process ( ) . stdout . on ( 'data' , data => console . info ( `[main] ${ data } ` ) ) ;
73
- electronApp . process ( ) . stderr . on ( 'data' , error => console . info ( `[main] ${ error } ` ) ) ;
74
- electronApp . process ( ) . stderr . on ( 'data' , error => logs . push ( `[main] ${ error } ` ) ) ;
75
-
76
- page = await electronApp . firstWindow ( ) ;
77
- console . info ( '[beforeEach] waited for firstWindow' ) ;
78
-
79
- // Log renderer process
80
- page . on ( 'console' , log => console . info ( `[renderer] ${ log . text ( ) } ` ) ) ;
81
- page . on ( 'console' , log => {
82
- if ( log . type ( ) === 'error' ) {
83
- logs . push ( `[renderer] ${ log . text ( ) } ` ) ;
84
- }
85
- } ) ;
86
- } catch ( error ) {
87
- console . error ( '[beforeEach] failed to launch electronApp:' , error ) ;
88
- throw error ;
89
- }
55
+ console . info ( '[beforeEach] starting beforeEach' ) ;
56
+ // Reset console errors at the start of each test
57
+ logs = [ ] ;
58
+
59
+ // Pass in --test-mode for headless testing
60
+ electronApp = await electron . launch ( {
61
+ timeout : 60000 ,
62
+ cwd : exeDir ,
63
+ args : [ appInfo . main , '--disable-http-cache' , '--fl-test-mode' ] ,
64
+ executablePath : appInfo . executable // Path to the Electron executable
65
+ } ) ;
66
+ console . info ( '[beforeEach] launched electronApp' ) ;
67
+
68
+ await electronApp . evaluate ( async ( { session } ) => await session . defaultSession . clearCache ( ) ) ;
69
+
70
+ // Log main process
71
+ electronApp . process ( ) . stdout . on ( 'data' , data => console . info ( `[main] ${ data } ` ) ) ;
72
+ electronApp . process ( ) . stderr . on ( 'data' , error => console . info ( `[main] ${ error } ` ) ) ;
73
+ electronApp . process ( ) . stderr . on ( 'data' , error => logs . push ( `[main] ${ error } ` ) ) ;
74
+
75
+ page = await electronApp . firstWindow ( ) ;
76
+ console . info ( '[beforeEach] waited for firstWindow' ) ;
77
+
78
+ // Log renderer process
79
+ page . on ( 'console' , log => console . info ( `[renderer] ${ log . text ( ) } ` ) ) ;
80
+ page . on ( 'console' , log => {
81
+ if ( log . type ( ) === 'error' ) {
82
+ logs . push ( `[renderer] ${ log . text ( ) } ` ) ;
83
+ }
84
+ } ) ;
90
85
} ) ;
91
86
92
87
test . afterEach ( async ( ) => {
0 commit comments