<commit_before>const shell = require('shelljs');
const utils = require('./utils');

const directoriesToCheck = [
    'test/unit'
].join(' ');

const builder = {
    files: {
        default: directoriesToCheck
    }
};

const handler = argv => {

    shell.rm('-rf', `${utils.pkgPath}/coverage`);
    shell.exec(`${utils.binPath}/babel-node ${utils.nodeModulesPath}/isparta/bin/isparta cover --report html ${utils.nodeModulesPath}/mocha/bin/_mocha -- ${argv.files} --reporter min`, code => shell.exit(code));
    shell.exec(`node ${utils.nodeModulesPath}/istanbul/lib/cli check-coverage --statement 100 --branch 100 --function 100 --line 100`, code => shell.exit(code));

};

exports.command = 'coverage';
exports.describe = 'check your test coverage';
exports.builder = builder;
exports.handler = handler;<commit_msg>fix: make sure `coverage` exits with status `1` if there is an error<commit_after>const shell = require('shelljs');
const utils = require('./utils');

const directoriesToCheck = [
    'test/unit'
].join(' ');

const builder = {
    files: {
        default: directoriesToCheck
    }
};

const handler = argv => {

    shell.rm('-rf', `${utils.pkgPath}/coverage`);
    shell.exec(`${utils.binPath}/babel-node ${utils.nodeModulesPath}/isparta/bin/isparta cover --report html ${utils.nodeModulesPath}/mocha/bin/_mocha -- ${argv.files} --reporter min`);
    shell.exec(`node ${utils.nodeModulesPath}/istanbul/lib/cli check-coverage --statement 100 --branch 100 --function 100 --line 100`, code => shell.exit(code));

};

exports.command = 'coverage';
exports.describe = 'check your test coverage';
exports.builder = builder;
exports.handler = handler;
{'fraction_non_alphanumeric': 0.17237237237237238, 'fraction_numerical': 0.015015015015015015, 'mean_word_length': 4.0638297872340425, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4352985', 'n_tokens_mistral': 540, 'n_tokens_neox': 512, 'n_words': 119}