How to use the istanbul-lib-coverage.CoverageMap 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 DefinitelyTyped / DefinitelyTyped / types / istanbul-lib-source-maps / istanbul-lib-source-maps-tests.ts View on Github external
});

store.data['foo'].type.trim();

const sourceMap: RawSourceMap = {
	version: 1 as any as string, // Fixed by https://github.com/mozilla/source-map/pull/293 but the fix is not yet published
	sources: ['foo', 'bar'],
	names: ['foo', 'bar'],
	mappings: 'foo',
	file: 'foo'
};
store.registerMap('foo', sourceMap);

store.registerURL('foo', 'foo');

const map = new CoverageMap({});
const transformed = store.transformCoverage(map);
transformed.map.data;
transformed.sourceFinder('foo').trim();

store.dispose();

store.sourceStore.registerSource('foo', 'bar');
const source = store.sourceStore.getSource('foo');
if (source != null) {
	source.trim();
}