mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
32 lines
754 B
JavaScript
32 lines
754 B
JavaScript
var gulp = require('gulp');
|
|
var mocha = require('gulp-mocha');
|
|
var babel = require("gulp-babel");
|
|
|
|
var TESTS = 'test/*.js';
|
|
var REPORTER = 'dot';
|
|
|
|
gulp.task("default", ["babel"]);
|
|
|
|
gulp.task('test', function(){
|
|
return gulp.src(TESTS, {read: false})
|
|
.pipe(mocha({
|
|
timeout: 2000,
|
|
reporter: REPORTER,
|
|
bail: true,
|
|
globals: ['___eio', 'document']
|
|
}))
|
|
.once('error', function(){
|
|
process.exit(1);
|
|
})
|
|
.once('end', function(){
|
|
process.exit();
|
|
});
|
|
});
|
|
|
|
// By default, individual js files are transformed by babel and exported to /dist
|
|
gulp.task("babel", function(){
|
|
return gulp.src(["lib/*.js","lib/transports/*.js"], { base: 'lib' })
|
|
.pipe(babel())
|
|
.pipe(gulp.dest("dist"));
|
|
});
|