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

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


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

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

  it('should create config file and package.json', function(done) {
    var configFileName = 'theConfigFileName.js';

    var expectedFiles = [
      configFileName,
      'package.json'
    ];

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

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


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

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

  it('should create config file and package.json', function(done) {
    var configFileName = 'theConfigFileName.js';

    var expectedFiles = [
      configFileName,
      'package.json'
    ];

    helpers.mockPrompt(this.app, {
      'configName': configFileName
    });
    this.app.options['skip-install'] = true;
    this.app.run({}, function() {
      helpers.assertFiles(expectedFiles);
      done();
    });
  });

  describe('Unit test creation', function() {
    var generator;

    beforeEach(function(done) {
      generator = helpers.createGenerator('protractor:unit', [
        '../../unit'
      ], 'my-test');
      done();
    });

    it('should create a protractor unit test', function(done) {
      helpers.mockPrompt(generator, {
        'testType': 'protractor'
      });
      generator.run({}, function() {
        helpers.assertFiles(['my-testSpec.js']);
        done();
      })
    });
  });
});
{'fraction_non_alphanumeric': 0.16929637526652452, 'fraction_numerical': 0.0, 'mean_word_length': 2.7838709677419353, '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': '5750800', 'n_tokens_mistral': 719, 'n_tokens_neox': 697, 'n_words': 134}