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

Commit

Permalink
test: fix afterEach
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsSim committed Sep 7, 2024
1 parent b19ce20 commit 3511a32
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions app/tests/e2e/util/setup-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,16 @@ module.exports = () => {
test.afterEach( async () => {
try {
console.info( '[afterEach] setting global.willQuit to true...' );
await electronApp.evaluate( async () => global.willQuit = true );
console.info( '[afterEach] global.willQuit has been set to true - attempting to close the app...' );
await electronApp.close();
console.info( '[afterEach] the app has been closed.' );
} catch ( err ) {
console.error( '[afterEach] an error occurred:', err );
if ( electronApp ) {
await electronApp.evaluate( async () => global.willQuit = true );
console.info( '[afterEach] global.willQuit has been set to true - attempting to close the app...' );
await electronApp.close();
console.info( '[afterEach] the app has been closed.' );
} else {
console.warn( '[afterEach] electronApp is not defined, skipping close operation.' );
}
} catch ( error ) {
console.error( '[afterEach] an error occurred:', error );
}
} );

Expand Down

0 comments on commit 3511a32

Please sign in to comment.