How to use the istanbul-lib-report.getDefaultWatermarks function in istanbul-lib-report

To help you get started, we’ve selected a few istanbul-lib-report 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 flaviuse / mern-authentication / client / node_modules / istanbul-api / lib / config.js View on Github external
statements: 0,
                lines: 0,
                branches: 0,
                functions: 0,
                excludes: [] // Currently list of files (root + path). For future, extend to patterns.
            },
            each: {
                statements: 0,
                lines: 0,
                branches: 0,
                functions: 0,
                excludes: []
            }
        }
    };
    ret.reporting.watermarks = libReport.getDefaultWatermarks();
    ret.reporting['report-config'] = {};
    return ret;
}
github karma-runner / karma-coverage / lib / reporter.js View on Github external
// Instance variables
  // ------------------

  this.adapters = []

  // Options
  // -------

  var config = rootConfig.coverageReporter || {}
  var basePath = rootConfig.basePath
  var reporters = config.reporters
  var sourceMapStore = globalSourceMapStore.get(basePath)
  var includeAllSources = config.includeAllSources === true

  if (config.watermarks) {
    config.watermarks = helper.merge({}, istanbulLibReport.getDefaultWatermarks(), config.watermarks)
  }

  if (!helper.isDefined(reporters)) {
    reporters = [config]
  }

  var coverageMaps

  function normalize (key) {
    // Exclude keys will always be relative, but covObj keys can be absolute or relative
    var excludeKey = isAbsolute(key) ? path.relative(basePath, key) : key
    // Also normalize for files that start with `./`, etc.
    excludeKey = path.normalize(excludeKey)

    return excludeKey
  }
github istanbuljs / istanbuljs / packages / istanbul-api / lib / config.js View on Github external
statements: 0,
                lines: 0,
                branches: 0,
                functions: 0,
                excludes: [] // Currently list of files (root + path). For future, extend to patterns.
            },
            each: {
                statements: 0,
                lines: 0,
                branches: 0,
                functions: 0,
                excludes: []
            }
        }
    };
    ret.reporting.watermarks = libReport.getDefaultWatermarks();
    ret.reporting['report-config'] = {};
    return ret;
}
github istanbuljs / istanbuljs / packages / istanbul-api / lib / config.js View on Github external
ReportingOptions.prototype.watermarks = function() {
    const v = this.config.watermarks;
    const defs = libReport.getDefaultWatermarks();
    const ret = {};

    Object.keys(defs).forEach(k => {
        const mark = v[k];
        //it will already be a non-zero length array because of the way the merge works
        const message = isInvalidMark(mark, k);
        if (message) {
            console.error(message);
            ret[k] = defs[k];
        } else {
            ret[k] = mark;
        }
    });
    return ret;
};
github flaviuse / mern-authentication / client / node_modules / istanbul-api / lib / config.js View on Github external
ReportingOptions.prototype.watermarks = function() {
    const v = this.config.watermarks;
    const defs = libReport.getDefaultWatermarks();
    const ret = {};

    Object.keys(defs).forEach(k => {
        const mark = v[k];
        //it will already be a non-zero length array because of the way the merge works
        const message = isInvalidMark(mark, k);
        if (message) {
            console.error(message);
            ret[k] = defs[k];
        } else {
            ret[k] = mark;
        }
    });
    return ret;
};
github chialab / rna-cli / lib / TestRunners / TestRunner.js View on Github external
async reportCoverage(coverageReport, environment) {
        this.coverageMap.merge(coverageReport);
        const coverageMap = createCoverageMap(coverageReport);
        const remappedCoverageMap = await createSourceMapStore().transformCoverage(coverageMap);
        const reportDir = this.coverageDir.directory(environment);
        const context = createContext({
            dir: reportDir.path,
            watermarks: getDefaultWatermarks(),
            coverageMap: remappedCoverageMap,
        });
        createReporter('html').execute(context);
        createReporter('lcovonly').execute(context);
    }
}

istanbul-lib-report

Base reporting library for istanbul

BSD-3-Clause
Latest version published 1 year ago

Package Health Score

85 / 100
Full package analysis