How to use the mochawesome-report-generator/package.json.version function in mochawesome-report-generator

To help you get started, we’ve selected a few mochawesome-report-generator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github adamgruber / mochawesome / src / mochawesome.js View on Github external
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;

mochawesome-report-generator

Generates gorgeous HTML reports from mochawesome reporter.

MIT
Latest version published 3 years ago

Package Health Score

69 / 100
Full package analysis