<commit_before>var test       = require('tape');
var HttpServer = require('../lib/HttpServer.js');
var mock       = require('nodemock');

test('configs are set / read', function(t) {
  t.plan(2);

  // All the config stuff
  var config = mock.mock();
  var app    = mock.mock();

  // Registers are stuff
  app.mock('register')
    .takesF(function(tag, thing) { return tag === 'http'; })
    .returns(mock.mock('asInstance').takesAll());

  // Server is passed in first
  config.mock('get').takes('http.server', null);

  var server = new HttpServer(app, config);

  // fake out express with a successful connnect
  server.http = mock.mock('listen').takesF(function(port, callback) {
    callback(null);
  });

  // Add in all mocks here to ensure happens after init
  config.mock('get').takes('http.port', process.env.PORT || 8123);
  config.mock('get').takes('http.secret', 'supersecret');
  config.mock('get').takes('http.webroot', null);

  server.start().then(function() {
    t.pass('made it');
  });

  t.ok(config.assert());
});<commit_msg>actually check mocks for app obj<commit_after>var test       = require('tape');
var HttpServer = require('../lib/HttpServer.js');
var mock       = require('nodemock');

test('configs are set / read', function(t) {
  t.plan(3);

  // All the config stuff
  var config = mock.mock();
  var app    = mock.mock();

  // Registers are stuff
  app.mock('register')
    .takesF(function(tag, thing) { return tag === 'http'; })
    .returns(mock.mock('asInstance').takesAll());

  // Server is passed in first
  config.mock('get').takes('http.server', null);

  var server = new HttpServer(app, config);

  // fake out express with a successful connnect
  server.http = mock.mock('listen').takesF(function(port, callback) {
    callback(null);
  });

  // Add in all mocks here to ensure happens after init
  config.mock('get').takes('http.port', process.env.PORT || 8123);
  config.mock('get').takes('http.secret', 'supersecret');
  config.mock('get').takes('http.webroot', null);

  server.start().then(function() {
    t.pass('made it');
  });

  t.ok(config.assert());
  t.ok(app.assert());
});
{'fraction_non_alphanumeric': 0.18840579710144928, 'fraction_numerical': 0.004675081813931743, 'mean_word_length': 3.6420824295010847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5848246', 'n_tokens_mistral': 714, 'n_tokens_neox': 690, 'n_words': 164}