<commit_before>"use strict";

const Task = require('../Task'),
    gulp = require('gulp'),
    mocha = require('gulp-mocha'),
    istanbul = require('gulp-istanbul'),
    isparta = require('isparta'),
    Promise = require('bluebird');

class TestTask extends Task {

    constructor(buildManager) {
        super(buildManager);
        this.command = "test";
        let extension = null;
        if (this._buildManager.options.typescript) {
            require('ts-node/register');
            extension = 'ts';
        } else {
            require('babel-core/register');
            extension = 'js';
        }
        this.dependsOn = [() => {
            if (this._buildManager.options.typescript) return Promise.resolve();
            return gulp.src([this._buildManager.options.scripts + '*/*.' + extension])
                .pipe(istanbul({
                    instrumenter: isparta.Instrumenter,
                    includeUntested: true
                }))
                .pipe(istanbul.hookRequire());
        }];
    }

    action() {
        return gulp.src(this._buildManager.options.test, {read: false})
            .pipe(mocha({
                reporter: 'spec',
                compilers: {
                    ts: require('ts-node/register'),
                    js: require('babel-core/register')
                }
            }))
            .pipe(istanbul.writeReports({
                reporters: ['lcov', 'json', 'text', 'text-summary', 'cobertura']
            }))
    }
}

module.exports = TestTask;<commit_msg>Simplify test task since typescript coverage is not supported<commit_after>"use strict";

require('babel-core/register');

const Task = require('../Task'),
    gulp = require('gulp'),
    mocha = require('gulp-mocha'),
    istanbul = require('gulp-istanbul'),
    isparta = require('isparta'),
    Promise = require('bluebird');

class TestTask extends Task {

    constructor(buildManager) {
        super(buildManager);
        this.command = "test";
        this.dependsOn = [() => {
            if (this._buildManager.options.typescript) return Promise.resolve();
            return gulp.src([this._buildManager.options.scripts + '*/*.js'])
                .pipe(istanbul({
                    instrumenter: isparta.Instrumenter,
                    includeUntested: true
                }))
                .pipe(istanbul.hookRequire());
        }];
    }

    action() {
        return gulp.src(this._buildManager.options.test, {read: false})
            .pipe(mocha({
                reporter: 'spec',
                compilers: {
                    ts: require('ts-node/register'),
                    js: require('babel-core/register')
                }
            }))
            .pipe(istanbul.writeReports({
                reporters: ['lcov', 'json', 'text', 'text-summary', 'cobertura']
            }))
    }
}

module.exports = TestTask;
{'fraction_non_alphanumeric': 0.14280774550484093, 'fraction_numerical': 0.0, 'mean_word_length': 1.768421052631579, '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': '1431533', 'n_tokens_mistral': 818, 'n_tokens_neox': 775, 'n_words': 138}