<commit_before>'use strict';
var util = require('util');
var path = require('path');
var fse = require('fs-extra');
var assert = require('yeoman-assert');
var helpers = require('yeoman-test');

describe('JHipster generator module', function () {

  describe('default configuration', function () {
    before(function (done) {
      helpers.run(path.join( __dirname, '../generators/app'))
        .withPrompts({
          moduleName: 'hello-world',
          moduleDescription: 'hello world',
          hook: 'none',
          githubName: 'githubName',
          authorName: 'authorName',
          authorEmail: '<EMAIL>',
          authorUrl: 'authorUrl'
        })
        .on('end', done);
    });

    it('generate default files', function () {
      assert.file([
        '.editorconfig',
        '.eslintrc',
        '.gitattributes',
        '.gitignore',
        '.travis.yml',
        '.gulpfile.js',
        'package.json',
        'LICENSE',
        'README.md',
        'test/templates/default/.yo-rc.json',
        'test/test-app.js',
        'generators/app/index.js',
        'generators/app/templates/dummy.txt'
      ]);
    });

    it('doesn\'t generate entity files', function () {
      assert.noFile([
        'generators/entity/index.js',
        'generators/entity/templates/dummy.txt'
      ]);
    });
  })

  describe('hook postEntity on default generator', function () {
    before(function (done) {
      helpers.run(path.join( __dirname, '../generators/app'))
        .withPrompts({
          moduleName: 'hello-world',
          moduleDescription: 'hello world',
          hook: 'postEntity',
          hookCallback: 'app',
          githubName: 'githubName',
          authorName: 'authorName',
          authorEmail: '<EMAIL>',
          authorUrl: 'authorUrl'
        })
        .on('end', done);
    });

    it('generates default files', function () {
      assert.file([
        '.editorconfig',
        '.eslintrc',
        '.gitattributes',
        '.gitignore',
        '.travis.yml',
        '.gulpfile.js',
        'package.json',
        'LICENSE',
        'README.md',
        'test/templates/default/.yo-rc.json',
        'test/test-app.js',
        'generators/app/index.js',
        'generators/app/templates/dummy.txt'
      ]);
    });

    it('doesn\'t generate entity files', function () {
      assert.noFile([
        'generators/entity/index.js',
        'generators/entity/templates/dummy.txt'
      ]);
    });
  })

  describe('hook postEntity on entity', function () {
    before(function (done) {
      helpers.run(path.join( __dirname, '../generators/app'))
        .withPrompts({
          moduleName: 'hello-world',
          moduleDescription: 'hello world',
          hook: 'postEntity',
          hookCallback: 'entity',
          githubName: 'githubName',
          authorName: 'authorName',
          authorEmail: 'mail@mail',
          authorUrl: 'authorUrl'
        })
        .on('end', done);
    });

    it('generates default files', function () {
      assert.file([
        '.editorconfig',
        '.eslintrc',
        '.gitattributes',
        '.gitignore',
        '.travis.yml',
        '.gulpfile.js',
        'package.json',
        'LICENSE',
        'README.md',<commit_msg>update gulpfile.js filename in npm test<commit_after>'use strict';
var util = require('util');
var path = require('path');
var fse = require('fs-extra');
var assert = require('yeoman-assert');
var helpers = require('yeoman-test');

describe('JHipster generator module', function () {

  describe('default configuration', function () {
    before(function (done) {
      helpers.run(path.join( __dirname, '../generators/app'))
        .withPrompts({
          moduleName: 'hello-world',
          moduleDescription: 'hello world',
          hook: 'none',
          githubName: 'githubName',
          authorName: 'authorName',
          authorEmail: 'mail@mail',
          authorUrl: 'authorUrl'
        })
        .on('end', done);
    });

    it('generate default files', function () {
      assert.file([
        '.editorconfig',
        '.eslintrc',
        '.gitattributes',
        '.gitignore',
        '.travis.yml',
        'gulpfile.js',
        'package.json',
        'LICENSE',
        'README.md',
        'test/templates/default/.yo-rc.json',
        'test/test-app.js',
        'generators/app/index.js',
        'generators/app/templates/dummy.txt'
      ]);
    });

    it('doesn\'t generate entity files', function () {
      assert.noFile([
        'generators/entity/index.js',
        'generators/entity/templates/dummy.txt'
      ]);
    });
  })

  describe('hook postEntity on default generator', function () {
    before(function (done) {
      helpers.run(path.join( __dirname, '../generators/app'))
        .withPrompts({
          moduleName: 'hello-world',
          moduleDescription: 'hello world',
          hook: 'postEntity',
          hookCallback: 'app',
          githubName: 'githubName',
          authorName: 'authorName',
          authorEmail: '<EMAIL>',
          authorUrl: 'authorUrl'
        })
        .on('end', done);
    });

    it('generates default files', function () {
      assert.file([
        '.editorconfig',
        '.eslintrc',
        '.gitattributes',
        '.gitignore',
        '.travis.yml',
        'gulpfile.js',
        'package.json',
        'LICENSE',
        'README.md',
        'test/templates/default/.yo-rc.json',
        'test/test-app.js',
        'generators/app/index.js',
        'generators/app/templates/dummy.txt'
      ]);
    });

    it('doesn\'t generate entity files', function () {
      assert.noFile([
        'generators/entity/index.js',
        'generators/entity/templates/dummy.txt'
      ]);
    });
  })

  describe('hook postEntity on entity', function () {
    before(function (done) {
      helpers.run(path.join( __dirname, '../generators/app'))
        .withPrompts({
          moduleName: 'hello-world',
          moduleDescription: 'hello world',
          hook: 'postEntity',
          hookCallback: 'entity',
          githubName: 'githubName',
          authorName: 'authorName',
          authorEmail: '<EMAIL>',
          authorUrl: 'authorUrl'
        })
        .on('end', done);
    });

    it('generates default files', function () {
      assert.file([
        '.editorconfig',
        '.eslintrc',
        '.gitattributes',
        '.gitignore',
        '.travis.yml',
        'gulpfile.js',
        'package.json',
        'LICENSE',
        'README.md',
{'fraction_non_alphanumeric': 0.162203519510329, 'fraction_numerical': 0.0, 'mean_word_length': 1.984474885844749, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6767412', 'n_tokens_mistral': 1925, 'n_tokens_neox': 1893, 'n_words': 352}