<commit_before>import chai = require("chai");
import { CronParser } from "../src/cronParser";
let assert = chai.assert;

describe("CronParser", function () {
    describe("parse", function () {
        it("should parse 5 part cron", function () {
            assert.equal(new CronParser("* * * * *").parse().length, 7);
        });

        it("should parse 6 part cron with year", function () {
            assert.equal(new CronParser("* * * * * 2015").parse()[6], "2015");
            assert.equal(new CronParser("* * * * * 2015").parse()[0], "");
        });

        it("should parse 6 part cron with year", function () {
            assert.equal(new CronParser("* * * * * 2015").parse()[6], "2015");
            assert.equal(new CronParser("* * * * * 2015").parse()[0], "");
        });

        it("should blow up if expression is crap", function () {
            assert.throws(function () { new CronParser("sdlksCRAPdlkskl- dds").parse() }, 'Expression has only 2 parts. At least 5 parts are required.');
        });
    });
});<commit_msg>Make test description more elegant<commit_after>import chai = require("chai");
import { CronParser } from "../src/cronParser";
let assert = chai.assert;

describe("CronParser", function () {
    describe("parse", function () {
        it("should parse 5 part cron", function () {
            assert.equal(new CronParser("* * * * *").parse().length, 7);
        });

        it("should parse 6 part cron with year", function () {
            assert.equal(new CronParser("* * * * * 2015").parse()[6], "2015");
            assert.equal(new CronParser("* * * * * 2015").parse()[0], "");
        });

        it("should parse 6 part cron with year", function () {
            assert.equal(new CronParser("* * * * * 2015").parse()[6], "2015");
            assert.equal(new CronParser("* * * * * 2015").parse()[0], "");
        });

        it("should error if expression is not valid", function () {
            assert.throws(function () { new CronParser("sdlksCRAPdlkskl- dds").parse() }, 'Expression has only 2 parts. At least 5 parts are required.');
        });
    });
});
{'fraction_non_alphanumeric': 0.19263456090651557, 'fraction_numerical': 0.03210576015108593, 'mean_word_length': 2.6098807495741054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7014409', 'n_tokens_mistral': 673, 'n_tokens_neox': 590, 'n_words': 158}