<commit_before>/*global describe, beforeEach, it*/
'use strict';

var path    = require('path');
var helpers = require('yeoman-generator').test;


describe('gulpfile generator', function () {
    beforeEach(function (done) {
        helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
            if (err) {
                return done(err);
            }

            this.app = helpers.createGenerator('gulpfile:app', [
                '../../app'
            ]);
            done();
        }.bind(this));
    });

    it('creates expected files', function (done) {
        var expected = [
            // add files you expect to exist here.
            '.jshintrc',
            '.editorconfig'
        ];

        helpers.mockPrompt(this.app, {
            'someOption': true
        });
        this.app.options['skip-install'] = true;
        this.app.run({}, function () {
            helpers.assertFiles(expected);
            done();
        });
    });
});<commit_msg>Add test cases<commit_after>/*global describe, beforeEach, it*/
'use strict';

var path    = require('path');
var helpers = require('yeoman-generator').test;


describe('gulpfile generator', function () {
    beforeEach(function (done) {
        helpers.testDirectory(path.join(__dirname, 'temp'), function (err) {
            if (err) {
                return done(err);
            }

            this.app = helpers.createGenerator('gulpfile:app', [
                '../../app'
            ]);
            done();
        }.bind(this));
    });

    it('creates expected browser app files with package.json', function (done) {
        var expected = [ 'Gulpfile.js', 'package.json' ];

        helpers.mockPrompt(this.app, {
            'createPkgFile': true,
            'appType': 'browser'
        });

        this.app.options['skip-install'] = true;
        this.app.run({}, function () {
            helpers.assertFiles(expected, /gulp-livereload/);
            done();
        });
    });

    it('creates expected node app files with package.json', function (done) {
        var expected = [ 'Gulpfile.js', 'package.json' ];

        helpers.mockPrompt(this.app, {
            'createPkgFile': true,
            'appType': 'browser'
        });

        this.app.options['skip-install'] = true;
        this.app.run({}, function () {
            helpers.assertFiles(expected, /gulp-mocha/);
            done();
        });
    });

    it('creates expected node app files without package.json', function (done) {
        var expected = [ 'Gulpfile.js' ];

        helpers.mockPrompt(this.app, {
            'createPkgFile': false,
            'appType': 'node'
        });

        this.app.options['skip-install'] = true;
        this.app.run({}, function () {
            helpers.assertFiles(expected, /gulp-mocha/);
            done();
        });
    });

    it('creates expected browser app files without package.json', function (done) {
        var expected = [ 'Gulpfile.js' ];

        helpers.mockPrompt(this.app, {
            'createPkgFile': false,
            'appType': 'browser'
        });

        this.app.options['skip-install'] = true;
        this.app.run({}, function () {
            helpers.assertFiles(expected, /gulp-livereload/);
            done();
        });
    });
});
{'fraction_non_alphanumeric': 0.15759225650332728, 'fraction_numerical': 0.0, 'mean_word_length': 1.814468085106383, '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': '1963914', 'n_tokens_mistral': 962, 'n_tokens_neox': 933, 'n_words': 185}