<commit_before>const ServerAddr = 'ws://localhost:3000';

fdescribe('JS-Nexus Server', function() {

  // Throw error if a Nexus server is not running
  const testConnection = new EnsureConnection();
  onDoneTesting.then(() => testConnection.close());

  setSpecHelper(NexusSpecHelpers);

  beforeEach(function() {
    if(testConnection.closed) throw new Error('no connection');
  });

  describe('client.getHostList()', function() {
    it('only returns active hosts', async function() {
      const host1 = this.newHost();
      await host1.onRegistered();
      expect(host1.id).not.toEqual(undefined);
      expect(host1.name).not.toEqual(undefined);

      const host2 = this.newHost();
      await host2.onRegistered();
      expect(host2.id).not.toEqual(undefined);
      expect(host2.name).not.toEqual(undefined);

      const client = this.newClient();
      await client.onServerConnect();<commit_msg>Extract host id and name check to separate test<commit_after>const ServerAddr = 'ws://localhost:3000';

fdescribe('JS-Nexus Server', function() {

  // Throw error if a Nexus server is not running
  const testConnection = new EnsureConnection();
  onDoneTesting.then(() => testConnection.close());

  setSpecHelper(NexusSpecHelpers);

  beforeEach(function() {
    if(testConnection.closed) throw new Error('no connection');
  });

  it('can register a host', async function() {
    const host = this.newHost();
    await host.onRegistered();
    expect(host.id).not.toEqual(undefined);
    expect(host.name).not.toEqual(undefined);
    await host.close();
  });

  describe('client.getHostList()', function() {
    it('only returns active hosts', async function() {
      const host1 = this.newHost();
      await host1.onRegistered();

      const host2 = this.newHost();
      await host2.onRegistered();

      const client = this.newClient();
      await client.onServerConnect();
{'fraction_non_alphanumeric': 0.14082278481012658, 'fraction_numerical': 0.010548523206751054, 'mean_word_length': 3.9272727272727272, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '206388', 'n_tokens_mistral': 558, 'n_tokens_neox': 551, 'n_words': 128}