How to use the istanbul-lib-instrument.programVisitor function in istanbul-lib-instrument

To help you get started, we’ve selected a few istanbul-lib-instrument 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 DefinitelyTyped / DefinitelyTyped / types / istanbul-lib-instrument / istanbul-lib-instrument-tests.ts View on Github external
error.stack;
	} else {
		code.trim();
	}
});

const cov = instrumenter.lastFileCoverage();
Object.create(cov);

const map = instrumenter.lastSourceMap();
Object.create(map);

const initialCov = readInitialCoverage(code);
initialCov.gcv;

programVisitor(babelTypes);
programVisitor(babelTypes, filename);
programVisitor(babelTypes, filename, { coverageVariable: 'coverage' });
const visitor = programVisitor(babelTypes, filename, { inputSourceMap: sourceMap });

visitor.enter(filename);
const data = visitor.exit(filename);
Object.create(data.fileCoverage);
github DefinitelyTyped / DefinitelyTyped / types / istanbul-lib-instrument / istanbul-lib-instrument-tests.ts View on Github external
}
});

const cov = instrumenter.lastFileCoverage();
Object.create(cov);

const map = instrumenter.lastSourceMap();
Object.create(map);

const initialCov = readInitialCoverage(code);
initialCov.gcv;

programVisitor(babelTypes);
programVisitor(babelTypes, filename);
programVisitor(babelTypes, filename, { coverageVariable: 'coverage' });
const visitor = programVisitor(babelTypes, filename, { inputSourceMap: sourceMap });

visitor.enter(filename);
const data = visitor.exit(filename);
Object.create(data.fileCoverage);
github DefinitelyTyped / DefinitelyTyped / types / istanbul-lib-instrument / istanbul-lib-instrument-tests.ts View on Github external
code.trim();
	}
});

const cov = instrumenter.lastFileCoverage();
Object.create(cov);

const map = instrumenter.lastSourceMap();
Object.create(map);

const initialCov = readInitialCoverage(code);
initialCov.gcv;

programVisitor(babelTypes);
programVisitor(babelTypes, filename);
programVisitor(babelTypes, filename, { coverageVariable: 'coverage' });
const visitor = programVisitor(babelTypes, filename, { inputSourceMap: sourceMap });

visitor.enter(filename);
const data = visitor.exit(filename);
Object.create(data.fileCoverage);
github istanbuljs / babel-plugin-istanbul / src / index.js View on Github external
}
          let { inputSourceMap } = this.opts
          if (this.opts.useInlineSourceMaps !== false) {
            if (!inputSourceMap && this.file.inputMap) {
              inputSourceMap = this.file.inputMap.sourcemap
            }
          }
          const visitorOptions = {}
          Object.entries(schema.defaults.instrumentVisitor).forEach(([name, defaultValue]) => {
            if (name in this.nycConfig) {
              visitorOptions[name] = this.nycConfig[name]
            } else {
              visitorOptions[name] = schema.defaults.instrumentVisitor[name]
            }
          })
          this.__dv__ = programVisitor(t, realPath, {
            ...visitorOptions,
            inputSourceMap
          })
          this.__dv__.enter(path)
        },
        exit (path) {

istanbul-lib-instrument

Core istanbul API for JS code coverage

BSD-3-Clause
Latest version published 6 months ago

Package Health Score

81 / 100
Full package analysis