gulp-mocha
Advanced tools
Comparing version
'use strict'; | ||
const dargs = require('dargs'); | ||
const execa = require('execa'); | ||
const gutil = require('gulp-util'); | ||
const PluginError = require('plugin-error'); | ||
const through = require('through2'); | ||
@@ -46,3 +46,3 @@ // TODO: Use execa localDir option when available | ||
if (file.isStream()) { | ||
done(new gutil.PluginError('gulp-mocha', 'Streaming not supported')); | ||
done(new PluginError('gulp-mocha', 'Streaming not supported')); | ||
return; | ||
@@ -68,3 +68,3 @@ } | ||
.catch(err => { | ||
this.emit('error', new gutil.PluginError('gulp-mocha', err)); | ||
this.emit('error', new PluginError('gulp-mocha', err)); | ||
done(); | ||
@@ -71,0 +71,0 @@ }); |
{ | ||
"name": "gulp-mocha", | ||
"version": "4.3.1", | ||
"description": "Run Mocha tests", | ||
"license": "MIT", | ||
"repository": "sindresorhus/gulp-mocha", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"utils.js" | ||
], | ||
"keywords": [ | ||
"gulpplugin", | ||
"mocha", | ||
"test", | ||
"testing", | ||
"unit", | ||
"framework", | ||
"runner", | ||
"tdd", | ||
"bdd", | ||
"qunit", | ||
"spec", | ||
"tap" | ||
], | ||
"dependencies": { | ||
"dargs": "^5.1.0", | ||
"execa": "^0.6.0", | ||
"gulp-util": "^3.0.0", | ||
"mocha": "^3.0.0", | ||
"npm-run-path": "^2.0.2", | ||
"through2": "^2.0.3" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"gulp": "^3.9.1", | ||
"p-event": "^1.0.0", | ||
"xo": "*" | ||
} | ||
"name": "gulp-mocha", | ||
"version": "5.0.0", | ||
"description": "Run Mocha tests", | ||
"license": "MIT", | ||
"repository": "sindresorhus/gulp-mocha", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"utils.js" | ||
], | ||
"keywords": [ | ||
"gulpplugin", | ||
"mocha", | ||
"test", | ||
"testing", | ||
"unit", | ||
"framework", | ||
"runner", | ||
"tdd", | ||
"bdd", | ||
"qunit", | ||
"spec", | ||
"tap" | ||
], | ||
"dependencies": { | ||
"dargs": "^5.1.0", | ||
"execa": "^0.8.0", | ||
"mocha": "^4.1.0", | ||
"npm-run-path": "^2.0.2", | ||
"plugin-error": "^0.1.2", | ||
"through2": "^2.0.3" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"gulp": "^3.9.1", | ||
"p-event": "^1.0.0", | ||
"vinyl": "^2.1.0", | ||
"xo": "*" | ||
} | ||
} |
@@ -43,3 +43,3 @@ # gulp-mocha [](https://travis-ci.org/sindresorhus/gulp-mocha) | ||
Options are passed directly to the `mocha` binary, so you can use any its [command-line options](http://mochajs.org/#usage) in a camelCased form. Arrays are correctly converted to the comma separated list format Mocha expects. Listed below are some of the more commonly used options: | ||
Options are passed directly to the `mocha` binary, so you can use any its [command-line options](http://mochajs.org/#usage) in a camelCased form. Arrays and key/value objects are correctly converted to the comma separated list format Mocha expects. Listed below are some of the more commonly used options: | ||
@@ -65,2 +65,9 @@ | ||
##### reporterOptions | ||
Type: `Object`<br> | ||
Example: `{reportFilename: 'index.html'}` | ||
Reporter specific options. | ||
##### globals | ||
@@ -123,3 +130,4 @@ | ||
.pipe(mocha()) | ||
.once('error', () => { | ||
.once('error', err => { | ||
console.error(err); | ||
process.exit(1); | ||
@@ -133,5 +141,15 @@ }) | ||
Or you might just need to pass the `exit` option: | ||
```js | ||
gulp.task('test', () => | ||
gulp.src(['test/**/*.js'], {read: false}) | ||
.pipe(mocha({reporter: 'list', exit: true})) | ||
.on('error', console.error) | ||
); | ||
``` | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
7405
4.25%152
13.43%5
25%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated