<commit_before>/* global describe, it */
/* jslint node: true, esnext: true */

"use strict";

const chai = require('chai'),
  assert = chai.assert,
  expect = chai.expect,
  should = chai.should(),
  request = require("supertest-as-promised")(Promise),
  kronos = require('kronos-service-manager'),
  admin = require('../lib/adminService');

describe('service manager admin', () => {
  const flowDecl = {
    "name": "flow1",
    "type": "kronos-flow",
    "steps": {
      "s0": {
        "type": "kronos-stdin",
        "endpoints": {
          "out": "s1/in"
        }
      },
      "s1": {
        "type": "kronos-stdout"
      }
    }
  };

  let myManager = kronos.manager({
    kronos: {
      logLevel: "trace",
    },
    admin: {
      logLevel: "trace",
      port: 4711
    }
  }).then(manager =>
    Promise.all([
      require('kronos-flow').registerWithManager(manager),
      require('kronos-flow-control-step').registerWithManager(manager),
      require('kronos-step-stdio').registerWithManager(manager),
      require('kronos-http-routing-step').registerWithManager(manager),
      admin.registerWithManager(manager)
    ]).then(() => Promise.resolve(manager), console.log)
  ).catch(console.log);

  console.log(myManager);

  describe('flows', () => {
    xit('GET /flows', () => {
      return myManager.then(manager => {
        console.log(`${Object.keys(manager.services)}`);

        const as = manager.services.admin;

        try {<commit_msg>test: use manager(config, modules)<commit_after>/* global describe, it */
/* jslint node: true, esnext: true */

"use strict";

const chai = require('chai'),
  assert = chai.assert,
  expect = chai.expect,
  should = chai.should(),
  request = require("supertest-as-promised")(Promise),
  kronos = require('kronos-service-manager'),
  admin = require('../lib/adminService');

describe('service manager admin', () => {
  const flowDecl = {
    "name": "flow1",
    "type": "kronos-flow",
    "steps": {
      "s0": {
        "type": "kronos-stdin",
        "endpoints": {
          "out": "s1/in"
        }
      },
      "s1": {
        "type": "kronos-stdout"
      }
    }
  };

  let myManager = kronos.manager({
    kronos: {
      logLevel: "trace",
    },
    admin: {
      logLevel: "trace",
      port: 4711
    }
  }, [require('kronos-flow'),
    require('kronos-flow-control-step'),
    require('kronos-step-stdio'),
    require('kronos-http-routing-step'),
    admin
  ]);

  console.log(myManager);

  describe('flows', () => {
    it('GET /flows', () => {
      return myManager.then(manager => {
        console.log(`${Object.keys(manager.services)}`);

        const as = manager.services.admin;

        try {
{'fraction_non_alphanumeric': 0.18599481289366432, 'fraction_numerical': 0.005928121526491293, 'mean_word_length': 2.638814016172507, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 13, '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': '2182862', 'n_tokens_mistral': 929, 'n_tokens_neox': 909, 'n_words': 153}