Skip to content

Commit ab510ce

Browse files
committed
meta tweaks
1 parent 9bb2505 commit ab510ce

File tree

7 files changed

+39
-50
lines changed

7 files changed

+39
-50
lines changed

Diff for: .editorconfig

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ charset = utf-8
77
trim_trailing_whitespace = true
88
insert_final_newline = true
99

10-
[package.json]
10+
[{package.json,*.yml}]
1111
indent_style = space
1212
indent_size = 2
13-
14-
[*.md]
15-
trim_trailing_whitespace = false

Diff for: .jshintrc

-13
This file was deleted.

Diff for: .travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
sudo: false
22
language: node_js
33
node_js:
4-
- '5'
4+
- '6'
55
- '4'
66
- '0.12'
77
- '0.10'

Diff for: index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict';
2-
var domain = require('domain');
2+
var domain = require('domain'); // eslint-disable-line no-restricted-modules
33
var gutil = require('gulp-util');
44
var through = require('through');
55
var Mocha = require('mocha');
@@ -12,7 +12,7 @@ module.exports = function (opts) {
1212
var mocha = new Mocha(opts);
1313
var cache = {};
1414

15-
for (var key in require.cache) {
15+
for (var key in require.cache) { // eslint-disable-line guard-for-in
1616
cache[key] = true;
1717
}
1818

Diff for: package.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"node": ">=0.10.0"
1414
},
1515
"scripts": {
16-
"test": "mocha"
16+
"test": "xo && mocha"
1717
},
1818
"files": [
1919
"index.js"
@@ -39,5 +39,14 @@
3939
"req-cwd": "^1.0.1",
4040
"temp": "^0.8.3",
4141
"through": "^2.3.4"
42+
},
43+
"devDependencies": {
44+
"xo": "*"
45+
},
46+
"xo": {
47+
"envs": [
48+
"node",
49+
"mocha"
50+
]
4251
}
4352
}

Diff for: readme.md

+25-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gulp-mocha [![Build Status](https://travis-ci.org/sindresorhus/gulp-mocha.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-mocha)
22

3-
> Run [Mocha](https://github.com/mochajs/mocha/) tests
3+
> Run [Mocha](https://github.com/mochajs/mocha) tests
44
55
*Keep in mind that this is just a thin wrapper around Mocha and your issue is most likely with Mocha.*
66

@@ -20,17 +20,14 @@ $ npm install --save-dev gulp-mocha
2020
const gulp = require('gulp');
2121
const mocha = require('gulp-mocha');
2222

23-
gulp.task('default', () => {
24-
return gulp.src('test.js', {read: false})
23+
gulp.task('default', () =>
24+
gulp.src('test.js', {read: false})
2525
// 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+
);
2828
```
2929

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.
3431
3532

3633
## API
@@ -41,45 +38,45 @@ between runs. If your tests eventually fail within the watch task but pass when
4138

4239
##### ui
4340

44-
Type: `string`
45-
Default: `bdd`
46-
Values: `bdd`, `tdd`, `qunit`, `exports`
41+
Type: `string`<br>
42+
Default: `bdd`<br>
43+
Values: `bdd` `tdd` `qunit` `exports`
4744

48-
The interface to use.
45+
Interface to use.
4946

5047
##### reporter
5148

52-
Type: `string`
53-
Default: `spec` | `dot` prior to mocha v1.21.0
54-
Values: [reporters](https://github.com/mochajs/mocha/tree/master/lib/reporters)
49+
Type: `string`<br>
50+
Default: `spec`
51+
Values: [Reporters](https://github.com/mochajs/mocha/tree/master/lib/reporters)
5552

56-
The reporter that will be used.
53+
Reporter that will be used.
5754

58-
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.
5956

6057
##### globals
6158

62-
Type: `array`
59+
Type: `Array`
6360

6461
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).
6562

6663
##### timeout
6764

68-
Type: `number`
65+
Type: `number`<br>
6966
Default: `2000`
7067

7168
Test-case timeout in milliseconds.
7269

7370
##### bail
7471

75-
Type: `boolean`
72+
Type: `boolean`<br>
7673
Default: `false`
7774

7875
Bail on the first test failure.
7976

8077
##### ignoreLeaks
8178

82-
Type: `boolean`
79+
Type: `boolean`<br>
8380
Default: `false`
8481

8582
Ignore global leaks.
@@ -92,7 +89,7 @@ Only run tests matching the given pattern which is internally compiled to a RegE
9289

9390
##### require
9491

95-
Type: `array`
92+
Type: `Array`
9693

9794
Require custom modules before tests are run.
9895

@@ -104,16 +101,16 @@ Require custom modules before tests are run.
104101
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:
105102

106103
```js
107-
gulp.task('default', () => {
108-
return gulp.src('test.js')
104+
gulp.task('default', () =>
105+
gulp.src('test.js')
109106
.pipe(mocha())
110107
.once('error', () => {
111108
process.exit(1);
112109
})
113110
.once('end', () => {
114111
process.exit();
115-
});
116-
});
112+
})
113+
);
117114
```
118115

119116
### Babel
@@ -123,4 +120,4 @@ Add `require('babel-core/register');` to the top of your `gulpfile.js`. Make sur
123120

124121
## License
125122

126-
MIT © [Sindre Sorhus](http://sindresorhus.com)
123+
MIT © [Sindre Sorhus](https://sindresorhus.com)

Diff for: test/test.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* global afterEach, it */
21
'use strict';
32
var assert = require('assert');
43
var gutil = require('gulp-util');

0 commit comments

Comments
 (0)