<commit_before>/* Copyright © 2015 PointSource, LLC. All rights reserved. */
var sprout = require('../../index'),
    path = require('path'),
    request = require('request').defaults({jar: true}), //need cookies enabled since this is cookie session
    assert = require('assert'),
    util = require('./launchUtil');

describe('SERVER4 - test swagger stub gen', function () {
    this.timeout(5000);
    before(function (done) {
        util.launch('server4', {exec: '../../bin/swagger2js.js'}, done);
    });

    after(function (done) {
        util.finish(done);
    });


    it('Should generate stub handlers files', function () {
        var dir = 'fixtures/server4/handlers';
        var files = ['petstore.js', 'petstore2.js', 'petstore3.js', 'petstore4.js'];
        files.forEach(function (file) {
            var file = path.resolve(__dirname, dir, file);
            var mod = require(file);
            assert.ok(mod.findPets);
            assert.ok(mod.findPetById);
            assert.ok(mod.addPet);
            assert.ok(mod.deletePet);
        });
    });


});
<commit_msg>Disabling the swagger stub gen tests for now until they can be improved<commit_after>/* Copyright © 2015 PointSource, LLC. All rights reserved. */
var sprout = require('../../index'),
    path = require('path'),
    request = require('request').defaults({jar: true}), //need cookies enabled since this is cookie session
    assert = require('assert'),
    util = require('./launchUtil');

describe('SERVER4 - test swagger stub gen', function () {
    
    //TODO: Disabling this for now because it ends up modifies files, which is dangerous.
    //I'd rather things be returned to normal after running the tests
    return it('should test stubs');
    
    this.timeout(5000);
    before(function (done) {
        util.launch('server4', {exec: '../../bin/swagger2js.js'}, done);
    });

    after(function (done) {
        util.finish(done);
    });


    it('Should generate stub handlers files', function () {
        var dir = 'fixtures/server4/handlers';
        var files = ['petstore.js', 'petstore2.js', 'petstore3.js', 'petstore4.js'];
        files.forEach(function (file) {
            var file = path.resolve(__dirname, dir, file);
            var mod = require(file);
            assert.ok(mod.findPets);
            assert.ok(mod.findPetById);
            assert.ok(mod.addPet);
            assert.ok(mod.deletePet);
        });
    });


});

{'fraction_non_alphanumeric': 0.15632653061224488, 'fraction_numerical': 0.012244897959183673, 'mean_word_length': 2.5573294629898404, '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': '5158953', 'n_tokens_mistral': 720, 'n_tokens_neox': 690, 'n_words': 189}