<commit_before>import React from 'react';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import ErrorMessage from './ErrorMessage';

function TestList({ data: { loading, error, tests } }) {
  if (error) return <ErrorMessage message="Error loading tests." />;
  if (!loading) {
    return (
      <section>
        <ul>
          {tests.map((test, index) => (
            <li key={test.id}>
              <div>
                <span>{index + 1}. </span>
                {test.title}
              </div>
            </li>
          ))}
        </ul>
      </section>
    );
  }
  return <div>Loading</div>;
}

export const allTests = gql`
  query allTests {
    tests {
      id
      title
      description
    }
  }
`;

export default graphql(allTests)(TestList);
<commit_msg>Fix error message on TestList<commit_after>import React from 'react';
import { graphql } from 'react-apollo';
import gql from 'graphql-tag';
import ErrorMessage from './ErrorMessage';

function TestList({ data: { loading, error, tests } }) {
  if (error) return <ErrorMessage message={`Error loading tests (${error.message})`} />;
  if (!loading) {
    return (
      <section>
        <ul>
          {tests.map((test, index) => (
            <li key={test.id}>
              <div>
                <span>{index + 1}. </span>
                {test.title}
              </div>
            </li>
          ))}
        </ul>
      </section>
    );
  }
  return <div>Loading</div>;
}

export const allTests = gql`
  query allTests {
    tests {
      id
      title
      description
    }
  }
`;

export default graphql(allTests)(TestList);

{'fraction_non_alphanumeric': 0.1469512195121951, 'fraction_numerical': 0.0012195121951219512, 'mean_word_length': 1.8890845070422535, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 31, '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': '2958722', 'n_tokens_mistral': 508, 'n_tokens_neox': 501, 'n_words': 129}