File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ module.exports = function(compiler, options) {
8686 var cbs = callbacks ;
8787 callbacks = [ ] ;
8888 cbs . forEach ( function continueBecauseBundleAvailable ( cb ) {
89- cb ( ) ;
89+ cb ( stats ) ;
9090 } ) ;
9191 } ) ;
9292
@@ -130,7 +130,7 @@ module.exports = function(compiler, options) {
130130
131131 // wait for bundle valid
132132 function ready ( fn , req ) {
133- if ( state ) return fn ( ) ;
133+ if ( state ) return fn ( webpackStats ) ;
134134 if ( ! options . noInfo && ! options . quiet )
135135 options . log ( "webpack: wait until bundle finished: " + ( req . url || fn . name ) ) ;
136136 callbacks . push ( fn ) ;
Original file line number Diff line number Diff line change @@ -64,7 +64,9 @@ describe("Advanced API", function() {
6464 var instance = middleware ( compiler , options ) ;
6565 plugins . done ( doneStats ) ;
6666 setTimeout ( function ( ) {
67- instance . waitUntilValid ( done ) ;
67+ instance . waitUntilValid ( function ( ) {
68+ done ( ) ;
69+ } ) ;
6870 } ) ;
6971 } ) ;
7072
@@ -75,6 +77,17 @@ describe("Advanced API", function() {
7577 instance . waitUntilValid ( ) ;
7678 } ) ;
7779 } ) ;
80+
81+ it ( "callback should have stats argument" , function ( done ) {
82+ var instance = middleware ( compiler , options ) ;
83+ plugins . done ( doneStats ) ;
84+ setTimeout ( function ( ) {
85+ instance . waitUntilValid ( function ( stats ) {
86+ should ( stats ) . have . keys ( 'hasErrors' , 'hasWarnings' ) ;
87+ done ( ) ;
88+ } ) ;
89+ } ) ;
90+ } ) ;
7891 } ) ;
7992
8093 describe ( "invalidate" , function ( ) {
You can’t perform that action at this time.
0 commit comments