Skip to content

Commit

Permalink
mark failed test
Browse files Browse the repository at this point in the history
  • Loading branch information
TG199 committed Jan 3, 2025
1 parent f0d9524 commit ae2c3a3
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions lib/mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -1225,19 +1225,23 @@ Mocha.prototype.runGlobalTeardown = async function runGlobalTeardown(
* @param {object} [context] - context object
* @returns {Promise<object>} context object
*/
Mocha.prototype._runGlobalFixtures = async function _runGlobalFixtures(
fixtureFns = [],
context = {}
) {
for (const fixtureFn of fixtureFns) {
try {
await fixtureFn.call(context);
} catch (err) {
console.error(err.stack);
Mocha.prototype._runGlobalFixtures = async function _runGlobalFixtures(
fixtureFns = [],
context = {}
) {
for (const fixtureFn of fixtureFns) {
try {
await fixtureFn.call(context);
} catch (err) {
if (this.runner) {
this.runner.failures += 1;
}
console.error('Global fixture error:', err.stack);

}
}
}
return context;
};
return context;
};

/**
* Toggle execution of any global setup fixture(s)
Expand Down

0 comments on commit ae2c3a3

Please sign in to comment.