<commit_before>var gulp = require('gulp');
var opener = require('opener');
var browser = require('browser-sync');
var concat = require('gulp-concat');
var babel = require('gulp-babel');
var sequence = require('run-sequence');
var onBabelError = require('./babel-error.js');
var rimraf = require('rimraf').sync;

var CONFIG = require('../config.js');

// Runs unit tests
gulp.task('test', function(cb) {
  sequence('sass:foundation', 'test:transpile-js', 'watch', function() {
  browser.init({
    server: { 
      baseDir: 'test/visual',
      directory: true,
      routes: {
        "/assets": "_build/assets",
        "/motion-ui": "node_modules/motion-ui"
      }
    }
  });
  gulp.watch(['test/visual/**/*'], ['test:reload']);
}, cb)
});

gulp.task('test:reload', function(done) {
  browser.reload();
  done();
});

gulp.task('test:transpile-js', function(cb) {
  sequence('javascript:foundation', 'javascript:deps', function() {
  rimraf('test/javascript/js-tests.js');
  
  return gulp.src(CONFIG.TEST_JS_FILES)
  	.pipe(babel()
  		.on('error', onBabelError))
  	.pipe(concat('js-tests.js'))
  	.pipe(gulp.dest('test/javascript'));
}, cb)
});<commit_msg>fix: use callback function in test tasks<commit_after>var gulp = require('gulp');
var opener = require('opener');
var browser = require('browser-sync');
var concat = require('gulp-concat');
var babel = require('gulp-babel');
var sequence = require('run-sequence');
var onBabelError = require('./babel-error.js');
var rimraf = require('rimraf').sync;

var CONFIG = require('../config.js');

// Runs unit tests
gulp.task('test', function(cb) {
  sequence('sass:foundation', 'test:transpile-js', 'watch', function() {
  browser.init({
    server: { 
      baseDir: 'test/visual',
      directory: true,
      routes: {
        "/assets": "_build/assets",
        "/motion-ui": "node_modules/motion-ui"
      }
    }
  });
  gulp.watch(['test/visual/**/*'], ['test:reload']);
})
});

gulp.task('test:reload', function(done) {
  browser.reload();
  done();
});

gulp.task('test:transpile-js', function(cb) {
  sequence('javascript:foundation', 'javascript:deps', function() {
  rimraf('test/javascript/js-tests.js');
  
  return gulp.src(CONFIG.TEST_JS_FILES)
  	.pipe(babel()
  		.on('error', onBabelError))
  	.pipe(concat('js-tests.js'))
  	.pipe(gulp.dest('test/javascript'));
})
});
{'fraction_non_alphanumeric': 0.21108742004264391, 'fraction_numerical': 0.0, 'mean_word_length': 4.133479212253829, 'pattern_counts': {'":': 4, '<': 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': '5479360', 'n_tokens_mistral': 826, 'n_tokens_neox': 803, 'n_words': 140}