<commit_before>var fs = require('fs');
var path = require('path');
var expect = require('chai').expect;

var vagrant = require('../index');
var helpers = require('./helpers');
var describe = helpers.integration.describe;
var it = helpers.integration.it;

/* eslint no-unused-vars: ["error", { "args": "none" }] */
/* eslint quotes: "off" */

describe('it should test node-vagrant', function () {
    var machine;

    before(function (done) {
        machine = vagrant.create({ cwd: __dirname });
        done();
    });

    it('should test creation of example1 Vagrantfile', function (done) {
        this.timeout(20000);
        var config = require('./example1.config.json');
        machine.init('ubuntu/trusty64', config, function (err, out) {
            expect(err).to.not.exist;

            machine.isInitialized = true;
            var origLoc = path.join(__dirname, 'Vagrantfile');
            var exampleLoc = path.join(__dirname, 'example1.Vagrantfile');

            var Vagrantfile = fs.readFileSync(origLoc).toString();
            var exampleVagrantfile = fs.readFileSync(exampleLoc).toString();

            // for previewing purposes
            fs.writeFileSync(path.join(__dirname, 'out.example1.Vagrantfile'), Vagrantfile);

            expect(Vagrantfile.replace(/[\n\r]/gm, '')).to.equal(exampleVagrantfile.replace(/[\n\r]/gm, ''));
            fs.unlinkSync(origLoc);
            done();
        });
    });

    it('should test creation of example2 Vagranfile', function (done) {
        this.timeout(20000);
        var config = require('./example2.config.json');
        machine.init('ubuntu/trusty64', config, function (err, out) {
            expect(err).to.not.exist;

            machine.isInitialized = true;
            var origLoc = path.join(__dirname, 'Vagrantfile');
            var exampleLoc = path.join(__dirname, 'example2.Vagrantfile');

            var Vagrantfile = fs.readFileSync(origLoc).toString();
            var exampleVagrantfile = fs.readFileSync(exampleLoc).toString();

            // for previewing purposes
            fs.writeFileSync(path.join(__dirname, 'out.example2.Vagrantfile'), Vagrantfile);

            expect(Vagrantfile.replace(/[\n\r]/gm, '')).to.equal(exampleVagrantfile.replace(/[\n\r]/gm, ''));
            // fs.unlinkSync(origLoc);
            done();
        });
    });

    it('should destroy machine', function (done) {
        machine.destroy(function (err, res) {
            expect(err).to.not.exist;
            done();
        });<commit_msg>Add timeout on an integration test<commit_after>var fs = require('fs');
var path = require('path');
var expect = require('chai').expect;

var vagrant = require('../index');
var helpers = require('./helpers');
var describe = helpers.integration.describe;
var it = helpers.integration.it;

/* eslint no-unused-vars: ["error", { "args": "none" }] */
/* eslint quotes: "off" */

describe('it should test node-vagrant', function () {
    var machine;

    before(function (done) {
        machine = vagrant.create({ cwd: __dirname });
        done();
    });

    it('should test creation of example1 Vagrantfile', function (done) {
        this.timeout(20000);
        var config = require('./example1.config.json');
        machine.init('ubuntu/trusty64', config, function (err, out) {
            expect(err).to.not.exist;

            machine.isInitialized = true;
            var origLoc = path.join(__dirname, 'Vagrantfile');
            var exampleLoc = path.join(__dirname, 'example1.Vagrantfile');

            var Vagrantfile = fs.readFileSync(origLoc).toString();
            var exampleVagrantfile = fs.readFileSync(exampleLoc).toString();

            // for previewing purposes
            fs.writeFileSync(path.join(__dirname, 'out.example1.Vagrantfile'), Vagrantfile);

            expect(Vagrantfile.replace(/[\n\r]/gm, '')).to.equal(exampleVagrantfile.replace(/[\n\r]/gm, ''));
            fs.unlinkSync(origLoc);
            done();
        });
    });

    it('should test creation of example2 Vagranfile', function (done) {
        this.timeout(20000);
        var config = require('./example2.config.json');
        machine.init('ubuntu/trusty64', config, function (err, out) {
            expect(err).to.not.exist;

            machine.isInitialized = true;
            var origLoc = path.join(__dirname, 'Vagrantfile');
            var exampleLoc = path.join(__dirname, 'example2.Vagrantfile');

            var Vagrantfile = fs.readFileSync(origLoc).toString();
            var exampleVagrantfile = fs.readFileSync(exampleLoc).toString();

            // for previewing purposes
            fs.writeFileSync(path.join(__dirname, 'out.example2.Vagrantfile'), Vagrantfile);

            expect(Vagrantfile.replace(/[\n\r]/gm, '')).to.equal(exampleVagrantfile.replace(/[\n\r]/gm, ''));
            // fs.unlinkSync(origLoc);
            done();
        });
    });

    it('should destroy machine', function (done) {
        this.timeout(10000);
        machine.destroy(function (err, res) {
            expect(err).to.not.exist;
            done();
        });
{'fraction_non_alphanumeric': 0.15471993732863298, 'fraction_numerical': 0.009596553074813944, 'mean_word_length': 2.5269337016574585, 'pattern_counts': {'":': 2, '<': 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': '3056803', 'n_tokens_mistral': 1550, 'n_tokens_neox': 1485, 'n_words': 288}