<commit_before>should = require 'should'
connect = require 'connect'

make = require '../lib/makeAdapter'


setup = (services={}, routes={}, config={}) ->

  host = config.host || 'localhost'
  port = config.port || 3000

  should.exist host
  should.exist port

  url = "http://#{host}:#{port}"

  app = connect()
  should.exist app

  adapter = make services, routes
  should.exist adapter

  app.use connect.bodyParser()
  app.use adapter

  server = app.listen port
  should.exist server

  return {app, server, url}


module.exports = setup<commit_msg>Add assert messages<commit_after>should = require 'should'
connect = require 'connect'

make = require '../lib/makeAdapter'


setup = (services={}, routes=[], config={}) ->

  host = config.host || 'localhost'
  port = config.port || 3000

  should.exist host
  should.exist port

  url = "http://#{host}:#{port}"

  app = connect()
  should.exist app

  adapter = make services, routes
  should.exist adapter, 'adapter should exist'

  app.use connect.bodyParser()
  app.use adapter

  server = app.listen port
  should.exist server, 'server should exist'

  return {app, server, url}


module.exports = setup
{'fraction_non_alphanumeric': 0.13881748071979436, 'fraction_numerical': 0.006855184233076264, 'mean_word_length': 3.5803921568627453, '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': '1309246', 'n_tokens_mistral': 373, 'n_tokens_neox': 348, 'n_words': 107}