mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
see if this helps
This commit is contained in:
@@ -108,9 +108,22 @@ app.whenReady().then(async () => {
|
||||
// 3. regular `afterEach` hooks run.
|
||||
// 4. `afterAll` hook runs here to verify that there are no windows left open
|
||||
const { runCleanupFunctions } = require('./lib/spec-helpers');
|
||||
mocha.suite.on('suite', function attach (suite) {
|
||||
function attach (suite) {
|
||||
suite.afterEach('cleanup', runCleanupFunctions);
|
||||
suite.on('suite', attach);
|
||||
}
|
||||
mocha.suite.on('suite', (suite) => {
|
||||
attach(suite);
|
||||
suite.afterAll('end of test cleanup', async () => {
|
||||
const windowsLeftOpen = await closeAllWindows(true);
|
||||
if (windowsLeftOpen > 0) {
|
||||
console.log(`WARNING!!!!!!!!!! ${suite.fullTitle()} ${path.basename(suite.file)} left ${windowsLeftOpen} windows open!`);
|
||||
}
|
||||
const webContentsDangling = await cleanupWebContents();
|
||||
if (webContentsDangling > 0) {
|
||||
console.log(`WARNING!!!!!!!!!! ${suite.fullTitle()} ${path.basename(suite.file)} left ${webContentsDangling} WebContents dangling!`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (!process.env.MOCHA_REPORTER) {
|
||||
@@ -172,14 +185,6 @@ app.whenReady().then(async () => {
|
||||
|
||||
const { closeAllWindows, cleanupWebContents } = require('./lib/window-helpers');
|
||||
const cb = async () => {
|
||||
const windowsLeftOpen = await closeAllWindows(true);
|
||||
if (windowsLeftOpen > 0) {
|
||||
console.log(`WARNING!!!!!!!!!! cleaned up ${windowsLeftOpen} windows open!`);
|
||||
}
|
||||
const webContentsDangling = await cleanupWebContents();
|
||||
if (webContentsDangling > 0) {
|
||||
console.log(`WARNING!!!!!!!!!! cleaned up ${webContentsDangling} WebContents dangling!`);
|
||||
}
|
||||
// Ensure the callback is called after runner is defined
|
||||
process.nextTick(() => {
|
||||
process.exit(runner.failures);
|
||||
|
||||
Reference in New Issue
Block a user