You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// gulp-mocha needs filepaths so you can't have any plugins before it
26
-
.pipe(mocha({reporter:'nyan'}));
27
-
});
26
+
.pipe(mocha({reporter:'nyan'}))
27
+
);
28
28
```
29
29
30
-
> If you are writing a watch task to run your tests as you modify your `.js` files, be aware that you might run
31
-
into issues. This plugin runs your mocha tests within the same process as your watch task and state isn't reset
32
-
between runs. If your tests eventually fail within the watch task but pass when run in a standalone task or with
33
-
`mocha test`, then you need to use the [`gulp-spawn-mocha`](https://github.com/KenPowers/gulp-spawn-mocha) plugin.
30
+
> If you are writing a watch task to run your tests as you modify your `.js` files, be aware that you might run into issues. This plugin runs your Mocha tests within the same process as your watch task and state isn't reset between runs. If your tests eventually fail within the watch task but pass when run in a standalone task or with `mocha test`, then you need to use the [`gulp-spawn-mocha`](https://github.com/KenPowers/gulp-spawn-mocha) plugin.
34
31
35
32
36
33
## API
@@ -41,45 +38,45 @@ between runs. If your tests eventually fail within the watch task but pass when
This 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.
55
+
This 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.
59
56
60
57
##### globals
61
58
62
-
Type: `array`
59
+
Type: `Array`
63
60
64
61
List of accepted global variable names, example `['YUI']`. Accepts wildcards to match multiple global variables, e.g. `['gulp*']` or even `['*']`. See [Mocha globals option](http://mochajs.org/#globals-option).
65
62
66
63
##### timeout
67
64
68
-
Type: `number`
65
+
Type: `number`<br>
69
66
Default: `2000`
70
67
71
68
Test-case timeout in milliseconds.
72
69
73
70
##### bail
74
71
75
-
Type: `boolean`
72
+
Type: `boolean`<br>
76
73
Default: `false`
77
74
78
75
Bail on the first test failure.
79
76
80
77
##### ignoreLeaks
81
78
82
-
Type: `boolean`
79
+
Type: `boolean`<br>
83
80
Default: `false`
84
81
85
82
Ignore global leaks.
@@ -92,7 +89,7 @@ Only run tests matching the given pattern which is internally compiled to a RegE
92
89
93
90
##### require
94
91
95
-
Type: `array`
92
+
Type: `Array`
96
93
97
94
Require custom modules before tests are run.
98
95
@@ -104,16 +101,16 @@ Require custom modules before tests are run.
104
101
If your test suite is not exiting it might be because you still have a lingering callback, most often caused by an open database connection. You should close this connection or do the following:
105
102
106
103
```js
107
-
gulp.task('default', () =>{
108
-
returngulp.src('test.js')
104
+
gulp.task('default', () =>
105
+
gulp.src('test.js')
109
106
.pipe(mocha())
110
107
.once('error', () => {
111
108
process.exit(1);
112
109
})
113
110
.once('end', () => {
114
111
process.exit();
115
-
});
116
-
});
112
+
})
113
+
);
117
114
```
118
115
119
116
### Babel
@@ -123,4 +120,4 @@ Add `require('babel-core/register');` to the top of your `gulpfile.js`. Make sur
0 commit comments