Skip to content
This repository was archived by the owner on Aug 8, 2020. It is now read-only.

Commit 030b52d

Browse files
committed
Require Node.js 6
1 parent 0390c30 commit 030b52d

File tree

5 files changed

+26
-31
lines changed

5 files changed

+26
-31
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
* text=auto
2-
*.js text eol=lf
1+
* text=auto eol=lf

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: node_js
22
node_js:
3+
- '10'
34
- '8'
45
- '6'
5-
- '4'

index.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ const resolveCwd = require('resolve-cwd');
66
const execa = require('execa');
77

88
const BIN = require.resolve('ava/cli.js');
9-
const HUNDRED_MEGABYTES = 1000 * 1000 * 100;
109

11-
module.exports = opts => {
12-
opts = Object.assign({
10+
module.exports = options => {
11+
options = Object.assign({
1312
silent: false
14-
}, opts);
13+
}, options);
1514

1615
const files = [];
1716

@@ -30,9 +29,9 @@ module.exports = opts => {
3029

3130
cb(null, file);
3231
}, cb => {
33-
const args = [BIN].concat(files, '--color', dargs(opts, {excludes: ['nyc']}));
32+
const args = [BIN].concat(files, '--color', dargs(options, {excludes: ['nyc']}));
3433

35-
if (opts.nyc) {
34+
if (options.nyc) {
3635
const nycBin = resolveCwd('nyc/bin/nyc.js');
3736

3837
if (!nycBin) {
@@ -43,20 +42,17 @@ module.exports = opts => {
4342
args.unshift(nycBin);
4443
}
4544

46-
const ps = execa(process.execPath, args, {
47-
// TODO: Remove this when `execa` supports a `buffer: false` option
48-
maxBuffer: HUNDRED_MEGABYTES
49-
});
45+
const ps = execa(process.execPath, args, {buffer: false});
5046

51-
if (!opts.silent) {
47+
if (!options.silent) {
5248
ps.stdout.pipe(process.stdout);
5349
ps.stderr.pipe(process.stderr);
5450
}
5551

5652
ps.then(() => {
5753
cb();
58-
}).catch(err => {
59-
cb(new gutil.PluginError('gulp-ava', err));
54+
}).catch(error => {
55+
cb(new gutil.PluginError('gulp-ava', error));
6056
});
6157
});
6258
};

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"url": "sindresorhus.com"
1111
},
1212
"engines": {
13-
"node": ">=4"
13+
"node": ">=6"
1414
},
1515
"scripts": {
1616
"test": "xo && ava"
@@ -33,19 +33,19 @@
3333
"jasmine"
3434
],
3535
"dependencies": {
36-
"ava": "^0.25.0",
37-
"dargs": "^5.1.0",
38-
"execa": "^0.10.0",
39-
"gulp-util": "^3.0.6",
36+
"ava": "^1.0.1",
37+
"dargs": "^6.0.0",
38+
"execa": "^1.0.0",
39+
"gulp-util": "^3.0.8",
4040
"resolve-cwd": "^2.0.0",
41-
"through2": "^2.0.0"
41+
"through2": "^3.0.0"
4242
},
4343
"devDependencies": {
44-
"gulp": "^3.9.1",
44+
"gulp": "^4.0.0",
4545
"hooker": "^0.2.3",
46-
"nyc": "^11.0.3",
46+
"nyc": "^13.1.0",
4747
"vinyl-file": "^3.0.0",
48-
"xo": "*"
48+
"xo": "^0.23.0"
4949
},
5050
"xo": {
5151
"rules": {

test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@ import test from 'ava';
22
import vinylFile from 'vinyl-file';
33
import hooker from 'hooker';
44
import gutil from 'gulp-util';
5-
import m from '.';
5+
import ava from '.';
66

7-
test.cb(t => {
8-
const stream = m();
7+
test.cb('main', t => {
8+
const stream = ava();
99

10-
hooker.hook(process.stderr, 'write', (...args) => {
10+
hooker.hook(process.stdout, 'write', (...args) => {
1111
if (/2.*passed/.test(args.join(' '))) {
1212
hooker.unhook(gutil, 'log');
1313
t.pass();
1414
t.end();
1515
}
1616
});
1717

18-
stream.on('error', err => {
19-
t.ifError(err);
18+
stream.on('error', error => {
19+
t.ifError(error);
2020
t.end();
2121
});
2222

0 commit comments

Comments
 (0)