How to use the mochawesome-report-generator.create 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 mattermost / mattermost-webapp / e2e / run_tests.js View on Github external
},
                },
        });

        failedTests += totalFailed;
    }

    // Merge all json reports into one single json report
    const jsonReport = await merge({reportDir: mochawesomeReportDir});

    // Generate short summary to easily pickup via hook
    const summary = generateShortSummary(jsonReport);
    writeJsonToFile(summary, 'summary.json', mochawesomeReportDir);

    // Generate the html report file
    await generator.create(jsonReport, {reportDir: mochawesomeReportDir});

    // eslint-disable-next-line
    process.exit(failedTests); // exit with the number of failed tests
}
github ghiscoding / Angular-Slickgrid / test / cypress / cypress-mochawesome.js View on Github external
async function runTests() {
  await fse.remove('mochawesome-report') // remove the report folder
  const { totalFailed } = await cypress.run({
    browser: "chrome",
    reporter: "mochawesome",
    reporterOptions: {
      overwrite: false,
      html: false,
      json: true,
      quiet: true
    },
  }); // get the number of failed tests
  const jsonReport = await merge(); // generate JSON report
  await generator.create(jsonReport);
  process.exit(totalFailed); // exit with the number of failed tests
}
github adamgruber / mochawesome / dist / mochawesome.js View on Github external
function done(output, config, failures, exit) {
  return marge.create(output, config).then(function (_ref) {
    var _ref2 = (0, _slicedToArray3.default)(_ref, 2),
        htmlFile = _ref2[0],
        jsonFile = _ref2[1];

    log('Report JSON saved to ' + jsonFile, null, config);
    log('Report HTML saved to ' + htmlFile, null, config);
  }).catch(function (err) {
    log(err, 'error', config);
  }).then(function () {
    exit && exit(failures);
  });
}
github adamgruber / mochawesome / src / mochawesome.js View on Github external
function done(output, options, config, failures, exit) {
  return marge.create(output, options)
    .then(([ htmlFile, jsonFile ]) => {
      if (!htmlFile && !jsonFile) {
        log('No files were generated', 'warn', config);
      } else {
        jsonFile && log(`Report JSON saved to ${jsonFile}`, null, config);
        htmlFile && log(`Report HTML saved to ${htmlFile}`, null, config);
      }
    })
    .catch(err => {
      log(err, 'error', config);
    })
    .then(() => {
      exit && exit(failures > 0 ? 1 : 0);
    });
}
github TradeMe / tractor / plugins / mocha-specs / src / protractor / plugin.js View on Github external
protractorConfig.afterLaunch = async function (...args) {
        const reports = await existsAsync(reportDirOptions.reportDir);
        if (reports) {
            const report = await merge(reportDirOptions);
            await marge.create(report, { autoOpen, ...reportDirOptions });
            await rimrafAsync(path.resolve(reportDirOptions.reportDir, './*.json'));    
        }
        if (afterLaunch) {
            afterLaunch.call(this, ...args);
        }
    };
github YOU54F / cypress-docker-typescript / e2e / script.ts View on Github external
return merge(options).then((report: any) => 
    marge.create(report, options)
  );

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