const gulp = require('gulp');  
const mocha = require('gulp-mocha');  
const nodemon = require('gulp-nodemon');

gulp.task('default', () => {  
    nodemon({
        script: './bin/www',
        ext: 'js',
        tasks: ['mocha'],
        env: { 'NODE_ENV': 'development' }
    })
});

gulp.task('mocha', () => {  
    gulp.src(process.cwd() + '/tests/index.js', {read: false})
    .pipe(
        mocha({
            reporter: 'nyan'
        })
    );
});