Using gulp-mocha , can I pass in a compilers flag?

191 views
Skip to first unread message

Justin Maat

unread,
Mar 4, 2015, 11:32:32 AM3/4/15
to nod...@googlegroups.com

I'm trying to use the gulp-mocha module but can't figure out a good way to pass over the compilers flag. Is there a way to include this in my gulp task? Maybe in a separate pipe somehow?

Example if running mocha from command line (works fine)
mocha --compilers .:my_compiler.js test/**/*.js

Example if using gulp-mocha (but where can I specify a compiler)?

gulp.task('test', function () {
    gulp.src(["test/**/*.js"], {
        read: false
    })
        .pipe(mocha({
            reporter: 'spec'
        }))
        .pipe(exit());
});

I don't see a compilers option under the gulp-mocha plugin, so I'm thinking I need to somehow add the compilers by adding the text somehow through a pipe?  Have no idea how to do that however.


Justin Maat

unread,
Mar 4, 2015, 12:03:46 PM3/4/15
to nod...@googlegroups.com
Sorry , I just noticed the docs at the bottom states for coffeescript 

For CoffeeScript support, add require('coffee-script') with CoffeeScript 1.6- or require('coffee-script/register') with CoffeeScript 1.7+.

I added a require statement for my own compiler at the top of my gulp file and it magically worked. 
Reply all
Reply to author
Forward
0 new messages