How to use the mochawesome-report-generator.getBaseConfig 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 / dist / config.js View on Github external
'use strict';

var _assign = require('babel-runtime/core-js/object/assign');

var _assign2 = _interopRequireDefault(_assign);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var marge = require('mochawesome-report-generator');

// Grab shared base config from mochawesome-report-generator
var baseConfig = (0, _assign2.default)(marge.getBaseConfig(), {
  reportFilename: 'mochawesome',
  saveJson: true
});

var boolOpts = ['inlineAssets', 'autoOpen', 'enableCharts', 'enableCode', 'overwrite', 'quiet', 'dev'];

function _getOption(optToGet, options, isBool) {
  var envVar = 'MOCHAWESOME_' + optToGet.toUpperCase();
  // Order of precedence
  // 1. Config option
  // 2. Environment variable
  // 3. Base config
  if (options && typeof options[optToGet] !== 'undefined') {
    return isBool && typeof options[optToGet] === 'string' ? options[optToGet] === 'true' : options[optToGet];
  }
  if (typeof process.env[envVar] !== 'undefined') {

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