{"size": 667, "ext": "js", "max_stars_repo_path": "test/api/core/entrypoints/embedded/clientConnection.test.js", "max_stars_repo_name": "Aschen/kuzzle", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/api/core/entrypoints/embedded/clientConnection.test.js", "max_issues_repo_name": "Aschen/kuzzle", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/api/core/entrypoints/embedded/clientConnection.test.js", "max_forks_repo_name": "Aschen/kuzzle", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 30.3181818182, "max_line_length": 98, "alphanum_fraction": 0.5817091454}
const
  should = require('should'),
  ClientConnection = require('../../../../../lib/api/core/entrypoints/embedded/clientConnection');

describe('core/clientConnection', () => {
  describe('#constructor', () => {
    it('should throw if ips is not an array', () => {
      return should(() => new ClientConnection('protocol', 'ips'))
        .throw(TypeError, {message: 'Expected ips to be an Array, got string'});
    });

    it('should set headers', () => {
      const
        headers = {foo: 'bar'},
        connection = new ClientConnection('protocol', ['ip1', 'ip2'], headers);

      should(connection.headers)
        .be.exactly(headers);
    });
  });
});
