add running of mocha tests in gulp

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-12-21 00:49:17 +01:00
parent 905cf97a30
commit d2b5536d65
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,7 @@
const gulp = require('gulp')
const babel = require('gulp-babel')
const clean = require('gulp-clean')
const mocha = require('gulp-mocha')
const print = require('gulp-print').default
const nodemon = require('gulp-nodemon')
@ -17,7 +18,11 @@ gulp.task('clean', () =>
gulp.src('dist/*').pipe(clean())
)
/* WARNING: This is broken right now */
gulp.task('test', () =>
gulp.src('test/**/*.js', {read: false})
.pipe(mocha({reporter: 'list', compilers: '@babel/register'}))
)
gulp.task('build', () =>
gulp.src('src/**/*.js')
.pipe(babel())
@ -25,4 +30,4 @@ gulp.task('build', () =>
.pipe(gulp.dest('dist/'))
)
gulp.task('default', ['clean', 'build'])
gulp.task('default', ['clean', 'test', 'build'])

View File

@ -30,6 +30,7 @@
"gulp": "^3.9.1",
"gulp-babel": "^8.0.0-beta.2",
"gulp-clean": "^0.4.0",
"gulp-mocha": "^6.0.0",
"gulp-nodemon": "^2.2.1",
"gulp-print": "^5.0.0",
"mocha": "^5.2.0",
@ -41,7 +42,7 @@
},
"scripts": {
"start": "node server.js",
"test": "mocha --require @babel/register",
"test": "gulp test",
"testw": "mocha --require @babel/register --watch",
"cover": "nyc mocha",
"devel": "gulp devel",