<commit_before>var _     = require("underscore")
, assert  = require("assert")
, request = require("request")
, exec    = require("child_process").exec
, spawn   = require("child_process").spawn
;

function get() {
  var args = _.toArray(arguments);
  args[0] = 'http://localhost:5009' + args[0];
  request.apply(null, args);
}

describe( 'Express App', function () {

  before(function (done) {
    var server = spawn("bin/restart 5009");
    var is_done = false;
    var fin = function () {
      if (!is_done) {
        is_done = true;
        done();
      }
    }
    server.stdout.on('data', function (data) {
      fin();
      // process.stdout.write("" + data);
    });

    server.stderr.on('data', function (data) {
      fin();
      process.stdout.write("" + data);
    });

    server.on('close', function (code) {
      console.log('server closed: ' + code, "\n");
    });
  });

  after(function (done) {
    exec('bin/stop 5009', function (err, so, se) {
      if (so) console.log(so);
      if (se) console.log(se);
      if (err) {
        console.log('Error: ', err);
      }
      done();
    });
  });

  it( 'runs', function (done) {
    get('/', function (err, resp, body) {
      assert.equal(true, body.indexOf('/customer') > 0);
      done();
    });
  });

}); // === end desc
<commit_msg>Dev. checkpoint.<commit_after>var _     = require("underscore")
, assert  = require("assert")
, request = require("request")
, exec    = require("child_process").exec
, spawn   = require("child_process").spawn
;

function get() {
  var args = _.toArray(arguments);
  args[0] = 'http://localhost:5009' + args[0];
  request.apply(null, args);
}

describe( 'Express App', function () {

  before(function (done) {
    var server = spawn("bin/restart", ['5009']);
    var is_done = false;
    var fin = function () {
      if (!is_done) {
        is_done = true;
        done();
      }
    }
    server.stdout.on('data', function (data) {
      // process.stdout.write("" + data);
      if (data.toString().indexOf('isten') > 0)
        fin();
    });

    server.stderr.on('data', function (data) {
      fin();
      process.stdout.write("" + data);
    });

    server.on('close', function (code) {
      console.log('server closed: ' + code, "\n");
    });
  });

  after(function (done) {
    exec('bin/stop 5009', function (err, so, se) {
      if (so) console.log(so);
      if (se) console.log(se);
      if (err) {
        console.log('Error: ', err);
      }
      done();
    });
  });

  it( 'runs', function (done) {
    get('/', function (err, resp, body) {
      assert.equal(null, err);
      assert.equal(true, body.indexOf('/customer') > 0);
      done();
    });
  });

}); // === end desc

{'fraction_non_alphanumeric': 0.20235034887991185, 'fraction_numerical': 0.011384502387073081, 'mean_word_length': 2.470063694267516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '5671220', 'n_tokens_mistral': 937, 'n_tokens_neox': 903, 'n_words': 194}