<commit_before>'use strict';

/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
import * as mocha from 'mocha';
import * as coMocha from 'co-mocha';

coMocha(mocha);

import * as should from 'should';
const logger = require('./../logger_test.ts');
import * as chassis from '../../lib';
import {Health} from '../../lib';

import {Client} from '../../lib';
import {Server} from '../../lib/microservice/server';
import {Events} from "../../lib/events/index";

/* global describe it beforeEach afterEach*/

describe('binding the Health service', () => {
  let server: Server;
  chassis.config.load(process.cwd() + '/test', logger);
  before(function* start(): any {
    const cfg = yield chassis.config.get();
    console.log('The cfg contents are : ' + cfg.get('server'));
    server = new Server(cfg.get('server'));
    const healthSrv: Health = new Health(server, server.config);
    yield server.bind('health', healthSrv);
    yield server.start();
  });
  after(function* end(): any {
    yield server.end();
  });
  describe('provides an endpoint Check', () => {
    describe('when called with an service', () => {
      let health: any;
      before(function* init() {
        const cfg = yield chassis.config.get();
        const client: Client = new Client(cfg.get('client:health'));
        health = yield client.connect();
        should.exist(health.check);<commit_msg>Removed console log.<commit_after>'use strict';

/* eslint import/no-extraneous-dependencies: ["error", {"devDependencies": true}] */
import * as mocha from 'mocha';
import * as coMocha from 'co-mocha';

coMocha(mocha);

import * as should from 'should';
const logger = require('./../logger_test.ts');
import * as chassis from '../../lib';
import {Health} from '../../lib';

import {Client} from '../../lib';
import {Server} from '../../lib/microservice/server';
import {Events} from "../../lib/events/index";

/* global describe it beforeEach afterEach*/

describe('binding the Health service', () => {
  let server: Server;
  chassis.config.load(process.cwd() + '/test', logger);
  before(function* start(): any {
    const cfg = yield chassis.config.get();
    server = new Server(cfg.get('server'));
    const healthSrv: Health = new Health(server, server.config);
    yield server.bind('health', healthSrv);
    yield server.start();
  });
  after(function* end(): any {
    yield server.end();
  });
  describe('provides an endpoint Check', () => {
    describe('when called with an service', () => {
      let health: any;
      before(function* init() {
        const cfg = yield chassis.config.get();
        const client: Client = new Client(cfg.get('client:health'));
        health = yield client.connect();
        should.exist(health.check);
{'fraction_non_alphanumeric': 0.18214672930972173, 'fraction_numerical': 0.0, 'mean_word_length': 3.4789644012944985, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 9, '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': '5699384', 'n_tokens_mistral': 823, 'n_tokens_neox': 802, 'n_words': 236}