File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11node_modules
2+ package-lock.json
3+ yarn.lock
Original file line number Diff line number Diff line change 11'use strict' ;
22const dargs = require ( 'dargs' ) ;
33const execa = require ( 'execa' ) ;
4- const gutil = require ( 'gulp-util ' ) ;
4+ const PluginError = require ( 'plugin-error ' ) ;
55const through = require ( 'through2' ) ;
66// TODO: Use execa localDir option when available
77const npmRunPath = require ( 'npm-run-path' ) ;
@@ -43,7 +43,7 @@ module.exports = opts => {
4343
4444 function aggregate ( file , encoding , done ) {
4545 if ( file . isStream ( ) ) {
46- done ( new gutil . PluginError ( 'gulp-mocha' , 'Streaming not supported' ) ) ;
46+ done ( new PluginError ( 'gulp-mocha' , 'Streaming not supported' ) ) ;
4747 return ;
4848 }
4949
@@ -64,7 +64,7 @@ module.exports = opts => {
6464 done ( ) ;
6565 } )
6666 . catch ( err => {
67- this . emit ( 'error' , new gutil . PluginError ( 'gulp-mocha' , err ) ) ;
67+ this . emit ( 'error' , new PluginError ( 'gulp-mocha' , err ) ) ;
6868 done ( ) ;
6969 } ) ;
7070
Original file line number Diff line number Diff line change 3636 "dependencies" : {
3737 "dargs" : " ^5.1.0" ,
3838 "execa" : " ^0.6.0" ,
39- "gulp-util" : " ^3.0.0" ,
4039 "mocha" : " ^3.0.0" ,
4140 "npm-run-path" : " ^2.0.2" ,
41+ "plugin-error" : " ^0.1.2" ,
4242 "through2" : " ^2.0.3"
4343 },
4444 "devDependencies" : {
4545 "ava" : " *" ,
4646 "gulp" : " ^3.9.1" ,
4747 "p-event" : " ^1.0.0" ,
48+ "vinyl" : " ^2.1.0" ,
4849 "xo" : " *"
4950 }
5051}
Original file line number Diff line number Diff line change 11import fs from 'fs' ;
22import path from 'path' ;
33import test from 'ava' ;
4- import gutil from 'gulp-util ' ;
4+ import Vinyl from 'vinyl ' ;
55import pEvent from 'p-event' ;
66import mocha from '..' ;
77
88function fixture ( name ) {
99 const fileName = path . join ( __dirname , 'fixtures' , name ) ;
1010
11- return new gutil . File ( {
11+ return new Vinyl ( {
1212 path : fileName ,
1313 contents : fs . existsSync ( fileName ) ? fs . readFileSync ( fileName ) : null
1414 } ) ;
@@ -33,9 +33,7 @@ test('pass async AssertionError to mocha', async t => {
3333 const event = pEvent ( stream , 'error' ) ;
3434 stream . end ( fixture ( 'fixture-async.js' ) ) ;
3535 const error = await event ;
36- const throws = / t h r o w s a f t e r t i m e o u t / . test ( error . stdout ) ;
37- const uncaught = / U n c a u g h t A s s e r t i o n E r r o r : f a l s e = = t r u e / . test ( error . stdout ) ;
38- t . true ( throws || uncaught ) ;
36+ t . regex ( error . stdout , / t h r o w s a f t e r t i m e o u t | U n c a u g h t A s s e r t i o n E r r o r .* : f a l s e = = t r u e / ) ;
3937} ) ;
4038
4139test ( 'require two files' , async t => {
You can’t perform that action at this time.
0 commit comments