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) {
86
86
var cbs = callbacks ;
87
87
callbacks = [ ] ;
88
88
cbs . forEach ( function continueBecauseBundleAvailable ( cb ) {
89
- cb ( ) ;
89
+ cb ( stats ) ;
90
90
} ) ;
91
91
} ) ;
92
92
@@ -130,7 +130,7 @@ module.exports = function(compiler, options) {
130
130
131
131
// wait for bundle valid
132
132
function ready ( fn , req ) {
133
- if ( state ) return fn ( ) ;
133
+ if ( state ) return fn ( webpackStats ) ;
134
134
if ( ! options . noInfo && ! options . quiet )
135
135
options . log ( "webpack: wait until bundle finished: " + ( req . url || fn . name ) ) ;
136
136
callbacks . push ( fn ) ;
Original file line number Diff line number Diff line change @@ -64,7 +64,9 @@ describe("Advanced API", function() {
64
64
var instance = middleware ( compiler , options ) ;
65
65
plugins . done ( doneStats ) ;
66
66
setTimeout ( function ( ) {
67
- instance . waitUntilValid ( done ) ;
67
+ instance . waitUntilValid ( function ( ) {
68
+ done ( ) ;
69
+ } ) ;
68
70
} ) ;
69
71
} ) ;
70
72
@@ -75,6 +77,17 @@ describe("Advanced API", function() {
75
77
instance . waitUntilValid ( ) ;
76
78
} ) ;
77
79
} ) ;
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
+ } ) ;
78
91
} ) ;
79
92
80
93
describe ( "invalidate" , function ( ) {
You can’t perform that action at this time.
0 commit comments