UNPKG

341 BJavaScriptView Raw
1'use strict';
2var es = require('event-stream');
3var Mocha = require('mocha');
4
5module.exports = function (options) {
6 var mocha = new Mocha(options);
7
8 return es.through(function (file) {
9 mocha.addFile(file.path);
10 this.emit('data', file);
11 }, function () {
12 mocha.run(function (errCount) {
13 this.emit('end');
14 }.bind(this));
15 });
16};