UNPKG

1.64 kBMarkdownView Raw
1# [gulp](https://github.com/wearefractal/gulp)-mocha [![Build Status](https://secure.travis-ci.org/sindresorhus/gulp-mocha.png?branch=master)](http://travis-ci.org/sindresorhus/gulp-mocha)
2
3> Run [Mocha](http://visionmedia.github.io/mocha/) tests
4
5*Keep in mind that this is just a thin wrapper around Mocha and your issue is most likely with Mocha.*
6
7
8## Install
9
10Install with [npm](https://npmjs.org/package/gulp-mocha)
11
12```
13npm install --save-dev gulp-mocha
14```
15
16
17## Example
18
19```js
20var gulp = require('gulp');
21var mocha = require('gulp-mocha');
22
23gulp.task('default', function () {
24 gulp.src('app.js')
25 .pipe(mocha({ui: 'nyan'}));
26});
27```
28
29## API
30
31### mocha(options)
32
33
34#### options.ui
35
36Type: `String`
37Default: `bdd`
38Values: `bdd`, `tdd`, `qunit`, `exports`
39
40The interface to use.
41
42
43#### options.reporter
44
45Type: `String`
46Default: `dot`
47Values: [reporters](https://github.com/visionmedia/mocha/tree/master/lib/reporters)
48
49The reporter that will be used.
50
51This option can also be used to utilize third-party reporters. For example if you `npm install mocha-lcov-reporter` you can then do use `mocha-lcov-reporter` as value.
52
53
54#### options.globals
55
56Type: `Array`
57
58Accepted globals.
59
60
61#### options.timeout
62
63Type: `Number`
64Default: `2000`
65
66Test-case timeout in milliseconds.
67
68
69#### options.bail
70
71Type: `Boolean`
72Default: `false`
73
74Bail on the first test failure.
75
76
77#### options.ignoreLeaks
78
79Type: `Boolean`
80Default: `false`
81
82Ignore global leaks.
83
84
85#### options.grep
86
87Type: `String`
88
89Only run tests matching the given pattern which is internally compiled to a RegExp.
90
91
92## License
93
94MIT © [Sindre Sorhus](http://sindresorhus.com)