@@ -6,12 +6,11 @@ const resolveCwd = require('resolve-cwd');
66const execa = require ( 'execa' ) ;
77
88const 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} ;
0 commit comments