I am trying to run mocha with gulp with the configuration existed before. moch.opts has the following line.
--timeout 999999
--ui tdd
--full-trace
--recursive
--compilers js:babel-register
how to add them here :
gulp.task('test', function() {
return gulp.src('sampleTest/*.js', { read: false })
.pipe(mocha());
});
I believe you can either create properties on the options object passed to
gulp-mochaor you can just have it read the options file. In my case, I didn't want to duplicate things like--recursiveor--require test/_init.js, but I did want to override the reporter, so I use the code shown below:You may want to modify this so that it doesn't assume the default path to test files (e.g.
test/*.js), but in my simple case I didn't even need to pass a path to mocha. I'm just using gulp to trigger it (as if I had run on the command line something likemocha --opts test/mocha.opts --reporter min)