<commit_before>'use strict';

var karmaConf = require('../karma.config.js');

// karmaConf.files get populated in karmaFiles
karmaConf.files = [];

module.exports = function (gulp, $, config) {
  gulp.task('clean:test', function (cb) {
    return $.del(config.buildTestDir, cb);
  });

  gulp.task('buildTests', ['lint', 'clean:test'], function () {
    var typescriptFilter = $.filter('**/*.ts')
      , coffeeFilter = $.filter('**/*.coffee')
      , es6Filter = $.filter('**/*.es6')
      , jsFilter = $.filter('**/*.js');

    return gulp.src([config.unitTestFiles])
      .pipe(es6Filter)
      .pipe($.babel())
      .pipe($.rename(function (filePath) {
        filePath.extname = '.js';
      }))
      .pipe(es6Filter.restore())
      .pipe(typescriptFilter)
      .pipe($.typescript(config.tsProject))
      .pipe(typescriptFilter.restore())
      .pipe(coffeeFilter)
      .pipe($.coffee())
      .pipe(coffeeFilter.restore())
      .pipe(jsFilter)
      .pipe(gulp.dest(config.buildUnitTestsDir))
      .pipe(jsFilter.restore());
  });

  // inject scripts in karma.config.js
  gulp.task('karmaFiles', ['build', 'buildTests'], function () {
    var stream = $.streamqueue({objectMode: true});

    // add bower javascript
    stream.queue(gulp.src($.wiredep({
      devDependencies: true<% if (polymer) { %>,
      exclude: [/polymer/, /webcomponents/]<% } %>
    }).js));

    // add application templates
    stream.queue(gulp.src([config.buildTestDirectiveTemplateFiles]));

    // add application javascript
    stream.queue(gulp.src([
      config.buildJsFiles<% if (polymer) { %>,
      '!**/webcomponents.js'<% } %>,
      '!**/*_test.*'
    ])
      .pipe($.angularFilesort()));

    // add unit tests
    stream.queue(gulp.src([config.buildUnitTestFiles]));

    return stream.done()
      .on('data', function (file) {
        karmaConf.files.push(file.path);
      });
  });

  // run unit tests
  gulp.task('unitTest', ['lint', 'karmaFiles'], function (done) {
    $.karma.server.start(karmaConf, function () {
      done();
    });
  });

  gulp.task('build:e2eTest', function () {
    var typescriptFilter = $.filter('**/*.ts')
      , coffeeFilter = $.filter('**/*.coffee')
      , es6Filter = $.filter('**/*.es6')
      , jsFilter = $.filter('**/*.js');

    return gulp.src([config.e2eFiles])
      .pipe(es6Filter)
      .pipe($.babel())
      .pipe($.rename(function (filePath) {
        filePath.extname = '.js';
      }))
      .pipe(es6Filter.restore())
      .pipe(typescriptFilter)
      .pipe($.typescript(config.tsProject))
      .pipe(typescriptFilter.restore())
      .pipe(coffeeFilter)
      .pipe($.coffee())
      .pipe(coffeeFilter.restore())
      .pipe(jsFilter)
      .pipe(gulp.dest(config.buildE2eTestsDir))
      .pipe(jsFilter.restore());
  });

  // run e2e tests - SERVER MUST BE RUNNING FIRST
  gulp.task('e2eTest', ['lint', 'build', 'build:e2eTest'], function () {
    return gulp.src(config.buildE2eTests)
      .pipe($.protractor.protractor({
        configFile: 'protractor.config.js'
      }))
      .on('error', function (e) {
        console.log(e);
      });
  });

  // jscs:disable requireCamelCaseOrUpperCaseIdentifiers
  /* jshint -W106 */
  gulp.task('webdriverUpdate', $.protractor.webdriver_update);
  /* jshint +W106 */
  // jscs:enable requireCamelCaseOrUpperCaseIdentifiers
};
<commit_msg>fix(gulp/test) remove build task from e2eTest<commit_after>'use strict';

var karmaConf = require('../karma.config.js');

// karmaConf.files get populated in karmaFiles
karmaConf.files = [];

module.exports = function (gulp, $, config) {
  gulp.task('clean:test', function (cb) {
    return $.del(config.buildTestDir, cb);
  });

  gulp.task('buildTests', ['lint', 'clean:test'], function () {
    var typescriptFilter = $.filter('**/*.ts')
      , coffeeFilter = $.filter('**/*.coffee')
      , es6Filter = $.filter('**/*.es6')
      , jsFilter = $.filter('**/*.js');

    return gulp.src([config.unitTestFiles])
      .pipe(es6Filter)
      .pipe($.babel())
      .pipe($.rename(function (filePath) {
        filePath.extname = '.js';
      }))
      .pipe(es6Filter.restore())
      .pipe(typescriptFilter)
      .pipe($.typescript(config.tsProject))
      .pipe(typescriptFilter.restore())
      .pipe(coffeeFilter)
      .pipe($.coffee())
      .pipe(coffeeFilter.restore())
      .pipe(jsFilter)
      .pipe(gulp.dest(config.buildUnitTestsDir))
      .pipe(jsFilter.restore());
  });

  // inject scripts in karma.config.js
  gulp.task('karmaFiles', ['build', 'buildTests'], function () {
    var stream = $.streamqueue({objectMode: true});

    // add bower javascript
    stream.queue(gulp.src($.wiredep({
      devDependencies: true<% if (polymer) { %>,
      exclude: [/polymer/, /webcomponents/]<% } %>
    }).js));

    // add application templates
    stream.queue(gulp.src([config.buildTestDirectiveTemplateFiles]));

    // add application javascript
    stream.queue(gulp.src([
      config.buildJsFiles<% if (polymer) { %>,
      '!**/webcomponents.js'<% } %>,
      '!**/*_test.*'
    ])
      .pipe($.angularFilesort()));

    // add unit tests
    stream.queue(gulp.src([config.buildUnitTestFiles]));

    return stream.done()
      .on('data', function (file) {
        karmaConf.files.push(file.path);
      });
  });

  // run unit tests
  gulp.task('unitTest', ['lint', 'karmaFiles'], function (done) {
    $.karma.server.start(karmaConf, function () {
      done();
    });
  });

  gulp.task('build:e2eTest', function () {
    var typescriptFilter = $.filter('**/*.ts')
      , coffeeFilter = $.filter('**/*.coffee')
      , es6Filter = $.filter('**/*.es6')
      , jsFilter = $.filter('**/*.js');

    return gulp.src([config.e2eFiles])
      .pipe(es6Filter)
      .pipe($.babel())
      .pipe($.rename(function (filePath) {
        filePath.extname = '.js';
      }))
      .pipe(es6Filter.restore())
      .pipe(typescriptFilter)
      .pipe($.typescript(config.tsProject))
      .pipe(typescriptFilter.restore())
      .pipe(coffeeFilter)
      .pipe($.coffee())
      .pipe(coffeeFilter.restore())
      .pipe(jsFilter)
      .pipe(gulp.dest(config.buildE2eTestsDir))
      .pipe(jsFilter.restore());
  });

  // run e2e tests - SERVER MUST BE RUNNING FIRST
  gulp.task('e2eTest', ['lint', 'build:e2eTest'], function () {
    return gulp.src(config.buildE2eTests)
      .pipe($.protractor.protractor({
        configFile: 'protractor.config.js'
      }))
      .on('error', function (e) {
        console.log(e);
      });
  });

  // jscs:disable requireCamelCaseOrUpperCaseIdentifiers
  /* jshint -W106 */
  gulp.task('webdriverUpdate', $.protractor.webdriver_update);
  /* jshint +W106 */
  // jscs:enable requireCamelCaseOrUpperCaseIdentifiers
};

{'fraction_non_alphanumeric': 0.19368233723861783, 'fraction_numerical': 0.0063769835384843545, 'mean_word_length': 2.8449258836944127, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6116562', 'n_tokens_mistral': 2336, 'n_tokens_neox': 2243, 'n_words': 348}