<commit_before>'use strict';

var gulp = require('gulp');

var $ = require('gulp-load-plugins')();

var wiredep = require('wiredep');

var paths = gulp.paths;

function runTests (singleRun, done) {
  var bowerDeps = wiredep({
    directory: 'bower_components',
    exclude: ['bootstrap-sass-official'],
    dependencies: true,
    devDependencies: true
  });

  var partialsInjectFile = gulp.src(paths.tmp + '/partials/templateCacheHtml.js', { read: false });

  var testFiles = bowerDeps.js.concat([
    paths.src + '/{app,components}/**/*.js',
    paths.src + '/vendor/*.js',
    paths.tmp + '/partials/templateCacheHtml.js'
  ]);

  gulp.src(testFiles)
    .pipe($.karma({
      configFile: 'karma.conf.js',
      action: (singleRun)? 'run': 'watch'
    }))
    .on('error', function (err) {
      // Make sure failed tests cause gulp to exit non-zero
      throw err;
    });
}

gulp.task('test', ['partials'], function (done) { runTests(true /* singleRun */, done) });
gulp.task('test:auto', ['partials'], function (done) { runTests(false /* singleRun */, done) });<commit_msg>Update unit-tests.js<commit_after>'use strict';

var gulp = require('gulp');

var $ = require('gulp-load-plugins')();

var wiredep = require('wiredep');

var paths = gulp.paths;

function runTests (singleRun, done) {
  var bowerDeps = wiredep({
    directory: 'bower_components',
    exclude: ['bootstrap-sass-official'],
    dependencies: true,
    devDependencies: true
  });

  var partialsInjectFile = gulp.src(paths.tmp + '/partials/templateCacheHtml.js', { read: false });

  var testFiles = bowerDeps.js.concat([
    paths.src + '/{app,components}/**/*.js',
    paths.src + '/vendor/*.js',
    paths.tmp + '/partials/templateCacheHtml.js'
  ]);

  gulp.src(testFiles)
    .pipe($.karma({
      configFile: 'karma.conf.js',
      action: (singleRun)? 'run': 'watch'
    }))
    .on('error', function (err) {
      // Make sure failed tests cause gulp to exit non-zero
      throw err;
    });
}

gulp.task('test', ['partials'], function (done) { 
  runTests(true /* singleRun */, done); 
});
gulp.task('test:auto', ['partials'], function (done) { 
  runTests(false /* singleRun */, done); 
});
{'fraction_non_alphanumeric': 0.18707015130674004, 'fraction_numerical': 0.0, 'mean_word_length': 3.4897119341563787, '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': '6372884', 'n_tokens_mistral': 744, 'n_tokens_neox': 733, 'n_words': 159}