From d56e2e765e277b6426982d81d8514b0bcd342ffc Mon Sep 17 00:00:00 2001 From: Zheng Weihan Date: Mon, 25 Jan 2016 13:49:19 +0800 Subject: [PATCH] add gulp task runner add test to task. --- gulpfile.js | 18 ++++++++++++++++++ package.json | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 gulpfile.js diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 00000000..df74e4e6 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,18 @@ +var gulp = require('gulp'); +var mocha = require('gulp-mocha'); + +gulp.task('test', function(){ + return gulp.src('test/*.js', {read: false}) + .pipe(mocha({ + timeout: 2000, + reporter: 'dot', + bail: true, + globals: ['___eio', 'document'] + })) + .once('error', function () { + process.exit(1); + }) + .once('end', function () { + process.exit(); + }); +}); \ No newline at end of file diff --git a/package.json b/package.json index ad6c6627..ca353841 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,8 @@ "devDependencies": { "engine.io-client": "1.6.8", "expect.js": "0.2.0", + "gulp": "^3.9.0", + "gulp-mocha": "^2.2.0", "mocha": "2.3.4", "s": "0.1.1", "superagent": "0.15.4"