How to use the nyc/node_modules/istanbul-reports.create function in nyc

To help you get started, we’ve selected a few nyc 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 SSENSE / node-cucumber-testrail-sync / tests / coverage / merge.js View on Github external
}
    }
}

if (mergedCoverageMap === null) {
    console.warn('Warning: No cover files to be merged');
    return;
}

var context = libReport.createContext({
    dir: path.join(rootFolder, mergeIntoFolder)
});

tree = libReport.summarizers.pkg(mergedCoverageMap);

tree.visit(reports.create('html'), context);
tree.visit(reports.create('lcov'), context);

fs.writeFileSync(path.join(rootFolder, '..', '..', '.nyc_output', 'coverage-final.json'), JSON.stringify(mergedCoverageMap.toJSON()));
github SSENSE / node-cucumber-testrail-sync / tests / coverage / merge.js View on Github external
}
}

if (mergedCoverageMap === null) {
    console.warn('Warning: No cover files to be merged');
    return;
}

var context = libReport.createContext({
    dir: path.join(rootFolder, mergeIntoFolder)
});

tree = libReport.summarizers.pkg(mergedCoverageMap);

tree.visit(reports.create('html'), context);
tree.visit(reports.create('lcov'), context);

fs.writeFileSync(path.join(rootFolder, '..', '..', '.nyc_output', 'coverage-final.json'), JSON.stringify(mergedCoverageMap.toJSON()));