<commit_before>var assertions = require('../../assertions')(),
    should = assertions.chai.should(),
    sinon = assertions.sinon;

describe('Given middleware for unhandled exceptions', function () {
    var express = null,
        errorHandler = null,
        success = function() { return 'success'; };

    beforeEach(function () {
        express = { errorHandler: function() {} };
        errorHandler = sinon.stub(express, 'errorHandler');
    });

    describe('when the environment is development or test', function () {
        it('should use the a verbose error handle', function () {
            errorHandler.withArgs({ dumpExceptions: true, showStack: true }).returns(success);

            var errorHandlerDev = require('../../../lib/middleware/ErrorHandler')('development', express);
            errorHandlerDev.should.exist;
            errorHandlerDev().should.equal('success');

            var errorHandlerTest = require('../../../lib/middleware/ErrorHandler')('test', express);
            errorHandlerTest.should.exist;
            errorHandlerTest().should.equal('success');
        });
    });

    describe('when the environment production', function () {
        it('should use a concise error handler', function () {
            errorHandler.withArgs().returns(success);

            console.log(__dirname);

            var errorHandlerProd = require('../../../lib/middleware/ErrorHandler')('production', express);
            errorHandlerProd.should.exist;
            errorHandlerProd().should.equal('success');
        });
    });<commit_msg>Test to find working dir run for grunt test on TravisCI<commit_after>var assertions = require('../../assertions')(),
    should = assertions.chai.should(),
    sinon = assertions.sinon;

describe('Given middleware for unhandled exceptions', function () {
    var express = null,
        errorHandler = null,
        success = function() { return 'success'; };

    beforeEach(function () {
        express = { errorHandler: function() {} };
        errorHandler = sinon.stub(express, 'errorHandler');
    });

    describe('when the environment is development or test', function () {
        it('should use the a verbose error handle', function () {
            errorHandler.withArgs({ dumpExceptions: true, showStack: true }).returns(success);

            var errorHandlerDev = require('../../../lib/middleware/ErrorHandler')('development', express);
            errorHandlerDev.should.exist;
            errorHandlerDev().should.equal('success');

            var errorHandlerTest = require('../../../lib/middleware/ErrorHandler')('test', express);
            errorHandlerTest.should.exist;
            errorHandlerTest().should.equal('success');
        });
    });

    describe('when the environment production', function () {
        it('should use a concise error handler', function () {
            errorHandler.withArgs().returns(success);

            console.log(process.cwd());

            var errorHandlerProd = require('../../../lib/middleware/ErrorHandler')('production', express);
            errorHandlerProd.should.exist;
            errorHandlerProd().should.equal('success');
        });
    });
{'fraction_non_alphanumeric': 0.1482758620689655, 'fraction_numerical': 0.0, 'mean_word_length': 2.684757505773672, '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': '4656556', 'n_tokens_mistral': 791, 'n_tokens_neox': 763, 'n_words': 176}