<commit_before>var assert = require('assert');
var request = require('supertest');
var exec = require('child_process').exec;

var application = require(__dirname + '/server.js');

describe('server', function () {
    before(function () {
        application.listen();
    });

    after(function () {
        application.close();
    });

    describe('Array', function () {
        describe('#indexOf()', function () {
            it('should return -1 when the value is not present', function () {
                assert.equal(-1, [1, 2, 3].indexOf(5));
                assert.equal(-1, [1, 2, 3].indexOf(0));
            });
        });

        describe('#indexOf()', function () {
            it('should return -1 when the value is not present', function () {
                assert.equal(-1, [1, 2, 3].indexOf(5));
            });
        });

        describe('GET /', function() {
            it('respond with json', function(done) {
                request(application.app)
                    .get('/')
                    .set('Accept', 'application/json')
                    .expect('Content-Type', /html/)
                    .expect(200, done);
            });
        });

        describe('Run Abao', function() {
            it('respond with json', function(done) {
                this.timeout(15000);
                exec('abao ./raml/api.raml --server http://localhost:3000/api', function (err) {
                    done();
                });
            });
        });
    });
});
<commit_msg>Change abao test to use the local installation instead of the global.<commit_after>var assert = require('assert');
var request = require('supertest');
var exec = require('child_process').exec;

var application = require(__dirname + '/server.js');

describe('server', function () {
    before(function () {
        application.listen();
    });

    after(function () {
        application.close();
    });

    describe('Array', function () {
        describe('#indexOf()', function () {
            it('should return -1 when the value is not present', function () {
                assert.equal(-1, [1, 2, 3].indexOf(5));
                assert.equal(-1, [1, 2, 3].indexOf(0));
            });
        });

        describe('#indexOf()', function () {
            it('should return -1 when the value is not present', function () {
                assert.equal(-1, [1, 2, 3].indexOf(5));
            });
        });

        describe('GET /', function() {
            it('respond with json', function(done) {
                request(application.app)
                    .get('/')
                    .set('Accept', 'application/json')
                    .expect('Content-Type', /html/)
                    .expect(200, done);
            });
        });

        describe('Run Abao', function() {
            it('respond with json', function(done) {
                this.timeout(15000);
                exec('node node_modules/.bin/abao ./raml/api.raml --server http://localhost:3000/api', function (err, stdout) {
                    console.log(stdout);
                    done();
                });
            });
        });
    });
});

{'fraction_non_alphanumeric': 0.16793168880455409, 'fraction_numerical': 0.018342820999367487, 'mean_word_length': 1.6270764119601329, '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': '1987367', 'n_tokens_mistral': 860, 'n_tokens_neox': 794, 'n_words': 186}