<commit_before>const Jasmine = require('jasmine');
const { relative } = require('path');
const { testDir } = require('./shared/constants');

const options = {
    spec_dir: relative(process.cwd(), testDir),
    spec_files: ['*.js']
};

(async () => {
    console.log('Testing\n');
    const jasmine = new Jasmine();
    jasmine.loadConfig(options);
    jasmine.execute();
    await new Promise((res) => { jasmine.onComplete(res); });
    console.log('\nTest completed\n');
})().catch((err) => {
    console.error('\nTest failed\n');
    console.error(err);
});<commit_msg>Exit with -1 if test fails<commit_after>const Jasmine = require('jasmine');
const { relative } = require('path');
const { testDir } = require('./shared/constants');

const options = {
    spec_dir: relative(process.cwd(), testDir),
    spec_files: ['*.js']
};

(async () => {
    console.log('Testing\n');
    const jasmine = new Jasmine();
    jasmine.loadConfig(options);
    jasmine.execute();
    const passed = await new Promise((res) => { jasmine.onComplete(res); });
    console.log('\nTest completed\n');
    if (!passed) process.exit(-1);
})().catch((err) => {
    console.error('\nTest failed\n');
    console.error(err);
    process.exit(-1);
});
{'fraction_non_alphanumeric': 0.20585842148087877, 'fraction_numerical': 0.0024410089503661514, 'mean_word_length': 3.880952380952381, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6563159', 'n_tokens_mistral': 405, 'n_tokens_neox': 396, 'n_words': 79}