<commit_before><commit_msg>(errors) - Implement the unit tests<commit_after>const assert = require('assert');

const errorsJSON = require('../../errors/arsenalErrors.json');
const errors = require('../../index').errors;

describe('Runtime errors instance generation', () => {
    Object.keys(errors).forEach(index => {
        it(`should return and instance of ${index} Error`, (done) => {
            assert.deepStrictEqual(errors[index] instanceof Error, true,
                                   'should be an instance of Error');
            assert.deepStrictEqual(errors[index].code, errorsJSON[index].code,
                                   'Wrong Code');
            assert.deepStrictEqual(errors[index].description,
                                   errorsJSON[index].description,
                                   'Incorrect description');
            assert.deepStrictEqual(errors[index][index], true,
                                   `${index} key must be true`);
            done();
        });
    });
});
{'fraction_non_alphanumeric': 0.13307240704500978, 'fraction_numerical': 0.0, 'mean_word_length': 1.8980169971671388, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '879449', 'n_tokens_mistral': 240, 'n_tokens_neox': 237, 'n_words': 52}