Skip to content

Commit

Permalink
Require Node.js 6
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 23, 2018
1 parent fc5cc1f commit 1fd70f0
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
* text=auto
*.js text eol=lf
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '10'
- '8'
- '6'
- '4'
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ module.exports = opts => {
maxBuffer: HUNDRED_MEGABYTES
});

proc.then(result => {
this.emit('_result', result);
done();
})
proc
.then(result => {
this.emit('_result', result);
done();
})
.catch(err => {
this.emit('error', new PluginError('gulp-mocha', err.code > 0 ? 'There were test failures' : err));
done();
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
"node": ">=6"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -35,10 +35,10 @@
],
"dependencies": {
"dargs": "^5.1.0",
"execa": "^0.8.0",
"execa": "^0.10.0",
"mocha": "^5.2.0",
"npm-run-path": "^2.0.2",
"plugin-error": "^0.1.2",
"plugin-error": "^1.0.1",
"supports-color": "^5.4.0",
"through2": "^2.0.3"
},
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ gulp.task('default', () =>

#### options

Type: `Object`

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:


Expand Down
4 changes: 2 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ test('run unit test and fail', async t => {
const stream = mocha({suppress: true});
const error = pEvent(stream, 'error');
stream.end(fixture('fixture-fail.js'));
t.regex((await error).stdout, /1 failing/);
t.regex((await error).message, /There were test failures/);
});

test('pass async AssertionError to mocha', async t => {
const stream = mocha({suppress: true});
const event = pEvent(stream, 'error');
stream.end(fixture('fixture-async.js'));
const error = await event;
t.regex(error.stdout, /throws after timeout|Uncaught AssertionError.*: false == true/);
t.regex(error.message, /There were test failures/);
});

test('require two files', async t => {
Expand Down
1 change: 1 addition & 0 deletions utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

// TODO: Use `Object.entries` when targeting Node.js 8
function objectEntries(object) {
const entries = [];

Expand Down

0 comments on commit 1fd70f0

Please sign in to comment.