Code coverage report for src/shell.js

Statements: 100% (10 / 10)      Branches: 100% (2 / 2)      Functions: 100% (1 / 1)      Lines: 100% (10 / 10)      Ignored: none     

All files » src/ » shell.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48        1 3     3 3 3           3 3 3 3                                                 1      
'use strict';
/**
 * @return {number}
 */
function printResults(context) {
    var _ = require('lodash');
//    var wfs = require('./wfs');
 
    var errorCount = 0;
    var warnings = context.getMessages();
    var out = require('./formatters/' + context.options.format)(warnings);
//        if (context.options.outFile) {
//            wfs.file.write(context.options.outFile, out);
//        } else {
//            context.report(out);
//        }
    context.report(out);
    var grouped = _.groupBy(warnings, 'level');
    errorCount = grouped.ERROR ? grouped.ERROR.length : 0;
    return errorCount;
}
 
/**
 * print help for a command
 * @param {string} command
 * @return {number}
 */
//function printHelp(command) {
//    var wfs = require('./wfs');
//    var path = require('path');
//    var h = wfs.readJSON(path.resolve(__dirname, 'data/help.json'));
//    var commandHelp = h.commands[command];
//    if (!commandHelp) {
//        console.log('could not find help for command ' + command);
//        return 1;
//    }
//    var msg = 'SYNOPSIS\n' +
//        '   ' + commandHelp.SYNOPSIS + '\n' +
//        'DESCRIPTION\n' +
//        '   ' + commandHelp.DESCRIPTION;
//    console.log(msg);
//    return 0;
//}
 
module.exports = {
    printResults: printResults//,
//    printHelp: printHelp
};