<commit_before>var fs = require('fs'),
    gulp = require('gulp'),
    debug = require('gulp-debug'),
    cache = require('gulp-cached'),
    exec = require('child_process').exec,
    rename = require('gulp-rename'),
    browserify = require('gulp-browserify'),
    header = require('gulp-header'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglify'),
    ts = require('gulp-typescript');

console.log(fs.readFileSync('./LICENSE', 'utf8'));

var tsProject = ts.createProject('tsconfig.json');

gulp.task('browserify', function() {
    var tsResult = gulp.src('**/*.ts')
      .pipe(tsProject())
      .js.pipe(browserify({
        })).
        pipe(rename(function(path) {
            path.basename = 'neuralnetwork0';
        })).
        pipe(header(
            '/**' + fs.readFileSync('./LICENSE', 'utf8') + '*/\n\n'
        )).
        pipe(gulp.dest('./dist')).
        pipe(rename(function(path) {
            path.basename = 'neuralnetwork0.min';
        })).
        pipe(uglify()).
        pipe(header(
            '/**' + fs.readFileSync('./LICENSE', 'utf8') + '*/\n\n'
        )).
        pipe(gulp.dest('./dist'));
});

// gulp.task('licensify', function() {
//     return gulp.src(['./LICENSE', './dist/neuralNet.js']).
//         pipe(concat('all.js')).
//         pipe(gulp.dest('./dist'))
// });

gulp.task('build', function() {
    console.log('Performing incremental build...');

    var tsResult = tsProject.src().pipe(cache('build'))
        .pipe(debug({title: 'files'}))
        .pipe(tsProject()).pipe(gulp.dest('./build'));
});

gulp.task('test', function() {
    //var spawnSync = require("child_process").spawnSync;
    //spawnSync('npm', ['run', 'mocha', 'build/test/**/*.spec.js', '--colors'], { stdio: "inherit" });
    exec('npm run mocha "build/test/**/*.spec.js"', (err, stdout, stderr) => {
        if (err) {
            console.error(err);
            return;
        }
            console.log(stdout);
        }
    );
});

gulp.task('watch', function() {
    gulp.watch('**/*.ts', ['build', 'test']);
});

gulp.task('default', ['build']);<commit_msg>Added test task to default task queue<commit_after>var fs = require('fs'),
    gulp = require('gulp'),
    debug = require('gulp-debug'),
    cache = require('gulp-cached'),
    exec = require('child_process').exec,
    rename = require('gulp-rename'),
    browserify = require('gulp-browserify'),
    header = require('gulp-header'),
    concat = require('gulp-concat'),
    uglify = require('gulp-uglify'),
    ts = require('gulp-typescript');

console.log(fs.readFileSync('./LICENSE', 'utf8'));

var tsProject = ts.createProject('tsconfig.json');

gulp.task('browserify', function() {
    var tsResult = gulp.src('**/*.ts')
      .pipe(tsProject())
      .js.pipe(browserify({
        })).
        pipe(rename(function(path) {
            path.basename = 'neuralnetwork0';
        })).
        pipe(header(
            '/**' + fs.readFileSync('./LICENSE', 'utf8') + '*/\n\n'
        )).
        pipe(gulp.dest('./dist')).
        pipe(rename(function(path) {
            path.basename = 'neuralnetwork0.min';
        })).
        pipe(uglify()).
        pipe(header(
            '/**' + fs.readFileSync('./LICENSE', 'utf8') + '*/\n\n'
        )).
        pipe(gulp.dest('./dist'));
});

// gulp.task('licensify', function() {
//     return gulp.src(['./LICENSE', './dist/neuralNet.js']).
//         pipe(concat('all.js')).
//         pipe(gulp.dest('./dist'))
// });

gulp.task('build', function() {
    console.log('Performing incremental build...');

    var tsResult = tsProject.src().pipe(cache('build'))
        .pipe(debug({title: 'files'}))
        .pipe(tsProject()).pipe(gulp.dest('./build'));
});

gulp.task('test', function() {
    //var spawnSync = require("child_process").spawnSync;
    //spawnSync('npm', ['run', 'mocha', 'build/test/**/*.spec.js', '--colors'], { stdio: "inherit" });
    exec('npm run mocha "build/test/**/*.spec.js"', (err, stdout, stderr) => {
        if (err) {
            console.error(err);
            return;
        }
            console.log(stdout);
        }
    );
});

gulp.task('watch', function() {
    gulp.watch('**/*.ts', ['build', 'test']);
});

gulp.task('default', ['build', 'test']);
{'fraction_non_alphanumeric': 0.23270588235294118, 'fraction_numerical': 0.002352941176470588, 'mean_word_length': 2.5190397350993377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '854332', 'n_tokens_mistral': 1416, 'n_tokens_neox': 1405, 'n_words': 208}