<commit_before>#!/bin/bash

coffee ./server/index.coffee &
PID=$!
grunt test:ci
kill -9 "$PID"<commit_msg>feat(server): wait till the backend server is fully operational<commit_after>#!/bin/bash

SERVER_PORT=5000

# start the backend server and wait till it's fully operational
PORT="$SERVER_PORT" coffee ./server/index.coffee &
while ! nc -vz localhost "$SERVER_PORT" &> /dev/null; do
  echo "Waiting for the backend server..."
  sleep 0.250
done

echo "Backend server is fully operational!"

# grab the PID
SERVER_PID=$!

# run all specs
grunt test:ci

# kill the backend server
kill -9 "$SERVER_PID"
{'fraction_non_alphanumeric': 0.11960132890365449, 'fraction_numerical': 0.016611295681063124, 'mean_word_length': 4.532110091743119, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '7345630', 'n_tokens_mistral': 216, 'n_tokens_neox': 196, 'n_words': 69}