diff --git a/gulpfile.js b/gulpfile.js index 2aaf21ac..f961b699 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -3,7 +3,8 @@ const buffer = require('vinyl-buffer'); const fs = require('fs-extra'); const gulp = require('gulp'); const merge = require('merge-stream'); -const mochaPhantom = require('gulp-mocha-phantomjs'); +const mocha = require('gulp-mocha'); +const mochaPhantomJs = require('gulp-mocha-phantomjs'); const sorcery = require('sorcery'); const source = require('vinyl-source-stream'); const sourcemaps = require('gulp-sourcemaps'); @@ -71,9 +72,14 @@ gulp.task('browserify', ['tsc'], function() { return merge(bundleStream, copyAddons, copyStylesheets); }); -gulp.task('test-phantom', function () { +gulp.task('test-mocha', function () { + return gulp.src(['lib/*test.js', 'lib/**/*test.js'], {read: false}) + .pipe(mocha()) +}); + +gulp.task('test-mocha-phantomjs', function () { return gulp.src('test-harness.html') - .pipe(mochaPhantom()); + .pipe(mochaPhantomJs()); }); /** @@ -88,5 +94,5 @@ gulp.task('sorcery', ['browserify'], function () { }); gulp.task('build', ['sorcery']); - +gulp.task('test', ['test-mocha', 'test-mocha-phantomjs']); gulp.task('default', ['build']); diff --git a/package.json b/package.json index 8e766d2f..c95de73b 100644 --- a/package.json +++ b/package.json @@ -47,12 +47,12 @@ "glob": "^7.0.5", "gulp": "^3.9.1", "gulp-cli": "^1.2.2", + "gulp-mocha": "^3.0.1", "gulp-mocha-phantomjs": "^0.12.0", "gulp-sourcemaps": "1.9.1", "gulp-typescript": "^3.1.3", "jsdoc": "3.4.3", "merge-stream": "^1.0.1", - "mocha": "2.5.3", "node-pty": "^0.4.1", "nodemon": "1.10.2", "sleep": "^3.0.1", @@ -68,7 +68,7 @@ "start": "node demo/app", "dev": "nodemon -e js,ts --watch src --watch demo --exec npm start", "lint": "tslint src/*.ts src/**/*.ts", - "test": "mocha --recursive ./lib", + "test": "gulp test", "build:docs": "jsdoc -c jsdoc.json", "build": "gulp build", "prepublish": "npm run build"