Skip to content

Instantly share code, notes, and snippets.

@danielyogel
Created September 15, 2014 18:29
Show Gist options
  • Save danielyogel/a0b24e0fc7f821a2dafe to your computer and use it in GitHub Desktop.
Save danielyogel/a0b24e0fc7f821a2dafe to your computer and use it in GitHub Desktop.
gulpfile
/*
* FILES
* */
var unitTestFiles = 'dist/**/**.spec.js',
integrationTestFiles = 'dist/**/**.integSpec.js',
distJsFiles = 'dist/**/*.js',
es6files = 'es6/**/*.js';
/*
* Directories
* */
var distDirectory = 'dist/';
/*
* OPTIONS
* */
var mochaOpts = {reporter: 'spec'},
traceurOpts = {sourceMaps: true, modules: 'commonjs'};
/*
* ================= TASKS ======================================
* */
gulp.task('traceur', function () {
return gulp.src(es6files)
.pipe(traceur(traceurOpts))
.pipe(gulp.dest(distDirectory));
});
gulp.task('unit-tests', function () {
return gulp.src(unitTestFiles, {read: false})
.pipe(mocha(mochaOpts));
});
gulp.task('integration-tests', function () {
return gulp.src(integrationTestFiles, {read: false})
.pipe(mocha(mochaOpts));
});
/*
* Watch task
* */
gulp.task('watch', function () {
gulp.watch(es6files, ['traceur', 'unit-tests']);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment