<commit_before>Api = require('../lib/api')
Engine = require('../lib/engine')
Front = require('../lib/front/front')
WebSocket = require('ws')
WebSocketServer = require('ws').Server

describe 'Front', ->

  it 'should initialize', ->
    front = new Front

  describe 'Front.start', ->
    it 'should start, connect to api, and provide a WS server', ->
      api = new Api
      front = new Front
      engine = new Engine
      engine.start {port: 3043, host: "0.0.0.0" }, (err, server) =>
        # console.log err, server
        api.start {port: 3042, host: "0.0.0.0", engineEndpoint: 'ws://0.0.0.0:3043' }, (err, server) =>
          # console.log err, server
          front.start {port: 3044, host: "0.0.0.0", apiEndpoint: 'ws://0.0.0.0:3022' }, (err, server) =>
            # console.log err, server<commit_msg>[test] [fix] front test should now actually test front->api->engine connection<commit_after>WebSocket = require('ws')
WebSocketServer = require('ws').Server

Buttercoin = require('../lib/buttercoin')

describe 'Front', ->

  it 'can initialize', (done) ->
    @butter = new Buttercoin()
    done()

  it 'should start, connect to api, and provide a WS server', (done)->
    @butter.engine.start {port: 3043, host: "0.0.0.0" }, (err, server) =>
      @butter.api.start {port: 3042, host: "0.0.0.0", engineEndpoint: 'ws://0.0.0.0:3043' }, (err, server) =>
        @butter.front.start {port: 3044, host: "0.0.0.0", apiEndpoint: 'ws://0.0.0.0:3042' }, (err, server) =>
          done(null)
{'fraction_non_alphanumeric': 0.19307589880159787, 'fraction_numerical': 0.05326231691078562, 'mean_word_length': 2.955263157894737, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 10, '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': '5958576', 'n_tokens_mistral': 554, 'n_tokens_neox': 519, 'n_words': 136}