Skip to content
This repository was archived by the owner on Jan 1, 2025. It is now read-only.

Commit 1fc1478

Browse files
committed
test: undo changes - works on my machine...
1 parent 52b3b4c commit 1fc1478

File tree

1 file changed

+30
-35
lines changed

1 file changed

+30
-35
lines changed

app/tests/e2e/util/setup-test.js

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -52,41 +52,36 @@ module.exports = () => {
5252
} );
5353

5454
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+
} );
9085
} );
9186

9287
test.afterEach( async () => {

0 commit comments

Comments
 (0)