Dev: Use prettier to format code
This commit is contained in:
@@ -7,31 +7,36 @@ var collector = new istanbul.Collector(),
|
||||
|
||||
var remappedJson = require('../coverage/coverage-remapped.json');
|
||||
|
||||
var coverage = util.reduce(util.keys(remappedJson), function (result, source)
|
||||
{
|
||||
if (isSrc())
|
||||
{
|
||||
var correctPath = source.replace(path.resolve(__dirname, '../src'), path.resolve(__dirname, '../'));
|
||||
var coverage = util.reduce(
|
||||
util.keys(remappedJson),
|
||||
function(result, source) {
|
||||
if (isSrc()) {
|
||||
var correctPath = source.replace(
|
||||
path.resolve(__dirname, '../src'),
|
||||
path.resolve(__dirname, '../')
|
||||
);
|
||||
|
||||
var val = remappedJson[source];
|
||||
val.path = correctPath;
|
||||
result[correctPath] = val;
|
||||
}
|
||||
var val = remappedJson[source];
|
||||
val.path = correctPath;
|
||||
result[correctPath] = val;
|
||||
}
|
||||
|
||||
function isSrc(src)
|
||||
{
|
||||
return source.match(/src.*\.js$/) &&
|
||||
source.indexOf('node_modules') < 0 &&
|
||||
source.indexOf('util') < 0;
|
||||
}
|
||||
function isSrc(src) {
|
||||
return (
|
||||
source.match(/src.*\.js$/) &&
|
||||
source.indexOf('node_modules') < 0 &&
|
||||
source.indexOf('util') < 0
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
return result;
|
||||
},
|
||||
{}
|
||||
);
|
||||
|
||||
collector.add(coverage);
|
||||
|
||||
reporter.addAll(['html', 'lcov']);
|
||||
reporter.write(collector, true, function ()
|
||||
{
|
||||
reporter.write(collector, true, function() {
|
||||
console.log('open coverage/index.html to see the coverage report.');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user