Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const rootSuite = mapSuites(this.runner.suite, totalTestsRegistered, this.config);
const obj = {
stats: this.stats,
results: [ rootSuite ],
meta: {
mocha: {
version: mochaPkg.version
},
mochawesome: {
options: this.config,
version: pkg.version
},
marge: {
options: options.reporterOptions,
version: margePkg.version
}
}
};
obj.stats.testsRegistered = totalTestsRegistered.total;
const { passes, failures, pending, tests, testsRegistered } = obj.stats;
const passPercentage = (passes / (testsRegistered - pending)) * 100;
const pendingPercentage = (pending / testsRegistered) * 100;
obj.stats.passPercent = passPercentage;
obj.stats.pendingPercent = pendingPercentage;
obj.stats.other = (passes + failures + pending) - tests; // Failed hooks
obj.stats.hasOther = obj.stats.other > 0;
obj.stats.skipped = testsRegistered - tests;
obj.stats.hasSkipped = obj.stats.skipped > 0;