@@ -6,12 +6,11 @@ const resolveCwd = require('resolve-cwd');
6
6
const execa = require ( 'execa' ) ;
7
7
8
8
const BIN = require . resolve ( 'ava/cli.js' ) ;
9
- const HUNDRED_MEGABYTES = 1000 * 1000 * 100 ;
10
9
11
- module . exports = opts => {
12
- opts = Object . assign ( {
10
+ module . exports = options => {
11
+ options = Object . assign ( {
13
12
silent : false
14
- } , opts ) ;
13
+ } , options ) ;
15
14
16
15
const files = [ ] ;
17
16
@@ -30,9 +29,9 @@ module.exports = opts => {
30
29
31
30
cb ( null , file ) ;
32
31
} , cb => {
33
- const args = [ BIN ] . concat ( files , '--color' , dargs ( opts , { excludes : [ 'nyc' ] } ) ) ;
32
+ const args = [ BIN ] . concat ( files , '--color' , dargs ( options , { excludes : [ 'nyc' ] } ) ) ;
34
33
35
- if ( opts . nyc ) {
34
+ if ( options . nyc ) {
36
35
const nycBin = resolveCwd ( 'nyc/bin/nyc.js' ) ;
37
36
38
37
if ( ! nycBin ) {
@@ -43,20 +42,17 @@ module.exports = opts => {
43
42
args . unshift ( nycBin ) ;
44
43
}
45
44
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 } ) ;
50
46
51
- if ( ! opts . silent ) {
47
+ if ( ! options . silent ) {
52
48
ps . stdout . pipe ( process . stdout ) ;
53
49
ps . stderr . pipe ( process . stderr ) ;
54
50
}
55
51
56
52
ps . then ( ( ) => {
57
53
cb ( ) ;
58
- } ) . catch ( err => {
59
- cb ( new gutil . PluginError ( 'gulp-ava' , err ) ) ;
54
+ } ) . catch ( error => {
55
+ cb ( new gutil . PluginError ( 'gulp-ava' , error ) ) ;
60
56
} ) ;
61
57
} ) ;
62
58
} ;
0 commit comments