<commit_before>var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
var karma = require('karma').server;
var liveServer = require('gulp-live-server');
var mocha = require('gulp-mocha');
var protractor = require("gulp-protractor").protractor;

gulp.task('test-server', function(){

	/* run server tests */
	return gulp.src('test/server.spec.js',{read:false})
		.pipe(mocha({reporter:'spec'}))
	
});


gulp.task('test-browser',function(done){
	/* run browser tests with karma */
  return karma.start({
    configFile: __dirname + '/karma.conf.js',
    singleRun: true,
		reporters:['mocha','coverage'],
  }, function(){
		done();
	});
});

/* test ALL THE THINGS */
gulp.task('test', ['test-server','test-browser']);

/* serve the app */
gulp.task('serve', function () {
	
	var server = new liveServer('server.js');
	server.start();
	
  browserSync.init({
    notify: false,
    port: 8080,
    server: {
      baseDir: ['app'],
      routes: {
        '/bower_components': 'bower_components'
      }
    }
  });

  gulp.watch([
    'app/*.html',
    'app/scripts/**/*.js',
		'test/spec/**/*.js',
		'server.js'
  ],['test',server.start])
	.on('change', reload);
});

/* Run the browser tests inside of Chrome. */
gulp.task('serve-test',function(){
	
	browserSync.init({
    notify: false,
    port: 8090,
    server: {
      baseDir: ['test','app'],
      routes: {
        '/bower_components': 'bower_components'
      }
    }
  });
	
	gulp.watch([
    'app/*.html',
    'app/scripts/**/*.js',
    'test/spec/**/*.js'
  ]).on('change', reload);
});

gulp.task('coverage',['test-browser'],function(){
	browserSync.init({
    notify: false,
    port: 7777,
    server: {
      baseDir: ['test/coverage'],
    }
  });
	
	gulp.watch([
    'app/*.html',
    'app/scripts/**/*.js',
    'test/spec/**/*.js'
  ],['test-browser']).on('change', reload);
});

gulp.task('protractor',['serve'],function(done){
	return gulp.src(["./src/tests/*.js"])
	.pipe(protractor({
			configFile: "test/protractor.config.js",
			args: ['--baseUrl', 'http://127.0.0.1:8000']
	}))
	.on('error', function(e) { throw e })
	.on('end',process.exit);
});



/* Serve our app for development purposes. */
gulp.task('default',['test','serve']);<commit_msg>Add protractor to test task. Renamed coverage to serve-coverage.<commit_after>var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var reload = browserSync.reload;
var karma = require('karma').server;
var liveServer = require('gulp-live-server');
var mocha = require('gulp-mocha');
var protractor = require("gulp-protractor").protractor;

gulp.task('test-server', function(){

	/* run server tests */
	return gulp.src('test/server.spec.js',{read:false})
		.pipe(mocha({reporter:'spec'}))
	
});


gulp.task('test-browser',function(done){
	/* run browser tests with karma */
  return karma.start({
    configFile: __dirname + '/karma.conf.js',
    singleRun: true,
		reporters:['mocha','coverage'],
  }, function(){
		done();
	});
});

/* test ALL THE THINGS */
gulp.task('test', ['test-server','test-browser','protractor']);

/* serve the app */
gulp.task('serve', function () {
	
	var server = new liveServer('server.js');
	server.start();
	
  browserSync.init({
    notify: false,
    port: 8080,
    server: {
      baseDir: ['app'],
      routes: {
        '/bower_components': 'bower_components'
      }
    }
  });

  gulp.watch([
    'app/*.html',
    'app/scripts/**/*.js',
		'test/spec/**/*.js',
		'server.js'
  ],['test',server.start])
	.on('change', reload);
});

/* Run the browser tests inside of Chrome. */
gulp.task('serve-test',function(){
	
	browserSync.init({
    notify: false,
    port: 8090,
    server: {
      baseDir: ['test','app'],
      routes: {
        '/bower_components': 'bower_components'
      }
    }
  });
	
	gulp.watch([
    'app/*.html',
    'app/scripts/**/*.js',
    'test/spec/**/*.js'
  ]).on('change', reload);
});

gulp.task('serve-coverage',['test-browser'],function(){
	browserSync.init({
    notify: false,
    port: 7777,
    server: {
      baseDir: ['test/coverage'],
    }
  });
	
	gulp.watch([
    'app/*.html',
    'app/scripts/**/*.js',
    'test/spec/**/*.js'
  ],['test-browser']).on('change', reload);
});

gulp.task('protractor',['serve'],function(done){
	return gulp.src(["./src/tests/*.js"])
	.pipe(protractor({
			configFile: "test/protractor.config.js",
			args: ['--baseUrl', 'http://127.0.0.1:8000']
	}))
	.on('error', function(e) { throw e })
	.on('end',process.exit);
});


/* Serve our app for development purposes. */
gulp.task('default',['test','serve']);
{'fraction_non_alphanumeric': 0.227380695314187, 'fraction_numerical': 0.009501187648456057, 'mean_word_length': 3.3780718336483933, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5949741', 'n_tokens_mistral': 1741, 'n_tokens_neox': 1633, 'n_words': 289}