<commit_before>var assert = require('assert'),
    RepositoryClient = require('../../utils/repo-client'),
    proxyquire = require('proxyquire'),
    sinon = require('sinon'),
    jsonUtils = require('../../utils/json'),
    jsonMock = {},
    urlMap = proxyquire('../../handlers/mailing-list-reporter', {
        '../utils/json': jsonMock
    }),
    jsdom = require("jsdom");

describe('mailing list handler url mapping', function() {
    it('has an entry for the /maillist* URL', function() {
        assert(Object.keys(urlMap).indexOf('/maillist*') > -1,
            'handler does not have proper url mapping');
    });
});

describe('/maillist URL handler', function() {
    var initializer = urlMap['/maillist*'];

    it('is a function with title and description', function() {
        var handler = initializer();
        assert.equal(typeof handler, 'function', 'handler initializer does not return function');
        assert.equal('Mailing List Reporter', handler.title, 'bad handler title');
        assert(typeof handler.description, 'string', 'bad handler description string');
    });

});


describe('Build URL objects since', function() {
    after(function () {
        jsdom.env.restore();
    });
    it('should call jsdom.env at least twice', function() {
        var mockConfig = {
            "mailinglists": [
                {
                    "name": "List A",
                    "rosterUrl": "/ListA/roster/",
                    "archiveUrl": "/ListA/archive/",
                    "startmonth": 1,
                    "startyear": 2014
                }
            ]
        };
        var requestHandler = urlMap['/maillist*'](
            null, null, mockConfig
        );
        var mockRequest = {};
        var mockResponse = {};
        sinon.stub(jsdom, "env");
        requestHandler(mockRequest, mockResponse);
        assert(jsdom.env.callCount > 1);
    });
});<commit_msg>Removed old test.<commit_after>var assert = require('assert'),
    RepositoryClient = require('../../utils/repo-client'),
    proxyquire = require('proxyquire'),
    sinon = require('sinon'),
    jsonUtils = require('../../utils/json'),
    jsonMock = {},
    urlMap = proxyquire('../../handlers/mailing-list-reporter', {
        '../utils/json': jsonMock
    }),
    jsdom = require("jsdom");

describe('mailing list handler url mapping', function() {
    it('has an entry for the /maillist* URL', function() {
        assert(Object.keys(urlMap).indexOf('/maillist*') > -1,
            'handler does not have proper url mapping');
    });
});

describe('/maillist URL handler', function() {
    var initializer = urlMap['/maillist*'];

    it('is a function with title and description', function() {
        var handler = initializer();
        assert.equal(typeof handler, 'function', 'handler initializer does not return function');
        assert.equal('Mailing List Reporter', handler.title, 'bad handler title');
        assert(typeof handler.description, 'string', 'bad handler description string');
    });

});



{'fraction_non_alphanumeric': 0.16019736842105264, 'fraction_numerical': 0.002631578947368421, 'mean_word_length': 2.5074971164936564, 'pattern_counts': {'":': 6, '<': 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': '5381073', 'n_tokens_mistral': 837, 'n_tokens_neox': 812, 'n_words': 210}