How to use the istanbul-lib-coverage.classes function in istanbul-lib-coverage

To help you get started, we’ve selected a few istanbul-lib-coverage 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 makuga01 / dnsFookup / FE / node_modules / istanbul-lib-instrument / dist / source-coverage.js View on Github external
}
  };
}
/**
 * SourceCoverage provides mutation methods to manipulate the structure of
 * a file coverage object. Used by the instrumenter to create a full coverage
 * object for a file incrementally.
 *
 * @private
 * @param pathOrObj {String|Object} - see the argument for {@link FileCoverage}
 * @extends FileCoverage
 * @constructor
 */


class SourceCoverage extends _istanbulLibCoverage.classes.FileCoverage {
  constructor(pathOrObj) {
    super(pathOrObj);
    this.meta = {
      last: {
        s: 0,
        f: 0,
        b: 0
      }
    };
  }

  newStatement(loc) {
    const s = this.meta.last.s;
    this.data.statementMap[s] = cloneLocation(loc);
    this.data.s[s] = 0;
    this.meta.last.s += 1;
github istanbuljs / istanbuljs / packages / istanbul-lib-source-maps / lib / mapped.js View on Github external
/*
 Copyright 2015, Yahoo Inc.
 Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
 */
'use strict';

const { FileCoverage } = require('istanbul-lib-coverage').classes;

function locString(loc) {
    return [
        loc.start.line,
        loc.start.column,
        loc.end.line,
        loc.end.column
    ].join(':');
}

class MappedCoverage extends FileCoverage {
    constructor(pathOrObj) {
        super(pathOrObj);

        this.meta = {
            last: {