<commit_before>#!/bin/sh
set -e

rm -fr coverage

istanbulBin=node_modules/istanbul/lib/cli.js
karmaBin=node_modules/karma/bin/karma
mochaBin=node_modules/mocha/bin/_mocha

mochaArgs=$(shell/_get-test-directories.sh --opts mocha.opts)

# pretest tasks
node ./shell/pretest.js

# Run Node tests
node ${istanbulBin} cover ${mochaBin} -- ${mochaArgs}

# Run browser test
node ${karmaBin} start karma.config.js

# Combine Node / browser reports
node ${istanbulBin} report lcov

# Send to codecov.io
if [ -n "$CI" ]; then
    cat ./coverage/lcov.info | ./node_modules/.bin/codecov
fi

# Open in browser
test -n "`which open`" && open coverage/lcov-report/index.html<commit_msg>Wrap in else.<commit_after>#!/bin/sh
set -e

rm -fr coverage

istanbulBin=node_modules/istanbul/lib/cli.js
karmaBin=node_modules/karma/bin/karma
mochaBin=node_modules/mocha/bin/_mocha

mochaArgs=$(shell/_get-test-directories.sh --opts mocha.opts)

# pretest tasks
node ./shell/pretest.js

# Run Node tests
node ${istanbulBin} cover ${mochaBin} -- ${mochaArgs}

# Run browser test
node ${karmaBin} start karma.config.js

# Combine Node / browser reports
node ${istanbulBin} report lcov

# Send to codecov.io
if [ -n "$CI" ]; then
    cat ./coverage/lcov.info | ./node_modules/.bin/codecov
else
    # Open in browser
    test -n "`which open`" && open coverage/lcov-report/index.html
fi
{'fraction_non_alphanumeric': 0.1364306784660767, 'fraction_numerical': 0.0, 'mean_word_length': 4.025925925925926, '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': '4580071', 'n_tokens_mistral': 510, 'n_tokens_neox': 491, 'n_words': 120}