File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed
Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,43 @@ exports = module.exports = function(Gulp, util){
3939 } , done ) ;
4040 } ) ;
4141
42- it ( 'watch(glob, tasks) runs `tasks` in parallel after change' , function ( done ) {
42+ it ( 'watch(glob, tasks) runs tasks in parallel after change' , function ( done ) {
43+ var pile = [ ] ;
44+ var gulp = Gulp . create ( {
45+ log : false ,
46+ onHandleError : done
47+ } ) ;
48+
49+ gulp . task ( 'one' , function ( next ) {
50+ setTimeout ( function ( ) {
51+ pile . push ( 'one' ) ;
52+ if ( pile . length > 1 ) {
53+ pile . should . containDeep ( [ 'one' , 'two' ] ) ;
54+ done ( ) ;
55+ }
56+ next ( ) ;
57+ } , Math . random ( ) * 10 ) ;
58+ } ) ;
59+
60+ gulp . task ( 'two' , function ( next ) {
61+ setTimeout ( function ( ) {
62+ pile . push ( 'two' ) ;
63+ if ( pile . length > 1 ) {
64+ pile . should . containDeep ( [ 'one' , 'two' ] ) ;
65+ done ( ) ;
66+ }
67+ next ( ) ;
68+ } , Math . random ( ) * 10 ) ;
69+ } ) ;
70+
71+ setupTest ( function ( ) {
72+ var watcher = gulp . watch ( util . testFile , [ 'one' , 'two' ] , function ( ) {
73+ watcher . end ( ) ;
74+ } ) ;
75+ } , done ) ;
76+ } ) ;
77+
78+ it ( 'watch(glob, tasks, fn) onChange fn runs after tasks' , function ( done ) {
4379 var pile = [ ] ;
4480 var gulp = Gulp . create ( {
4581 log : false ,
You can’t perform that action at this time.
0 commit comments