<commit_before>#!/usr/bin/env bash

COMMAND="node index.js"

$COMMAND

$COMMAND --version

$COMMAND --help

node -e "require('babel-core/register'); require('./test/server').default(4002);" &
SERVER_PID=$!

# Waiting for server to load.
sleep 3

echo "No JS error"
$COMMAND http://localhost:4002/no-error
CODE=$?
echo $CODE
if [ $CODE -ne 0 ];
then
    exit 1;
fi

echo "JS error"
$COMMAND http://localhost:4002/error
CODE=$?
echo $CODE
if [ $CODE -ne 2 ];
then
    exit 1;
fi
<commit_msg>Start server before anything else to ensure it will be ready<commit_after>#!/usr/bin/env bash

node -e "require('babel-core/register'); require('./test/server').default(4002);" &
SERVER_PID=$!

# Waiting for server to load.
sleep 3

COMMAND="node index.js"

$COMMAND

$COMMAND --version

$COMMAND --help

echo "No JS error"
$COMMAND http://localhost:4002/no-error
CODE=$?
echo $CODE
if [ $CODE -ne 0 ];
then
    exit 1;
fi

echo "JS error"
$COMMAND http://localhost:4002/error
CODE=$?
echo $CODE
if [ $CODE -ne 2 ];
then
    exit 1;
fi

{'fraction_non_alphanumeric': 0.16195121951219513, 'fraction_numerical': 0.033170731707317075, 'mean_word_length': 3.816901408450704, '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': '991473', 'n_tokens_mistral': 399, 'n_tokens_neox': 380, 'n_words': 118}