File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,29 @@ const allStats = [
16
16
] ;
17
17
18
18
describe ( 'Server' , ( ) => {
19
+ it ( 'should cascade warningsFilter' , ( ) => {
20
+ const stats = { warningsFilter : 'test' } ;
21
+ return new Promise ( ( res ) => {
22
+ const compiler = webpack ( config ) ;
23
+ const server = new Server ( compiler , { stats } ) ;
24
+
25
+ compiler . hooks . done . tap ( 'webpack-dev-server' , ( s ) => {
26
+ s . compilation . warnings = [ 'test' , 'another warning' ] ;
27
+
28
+ const output = server . getStats ( s ) ;
29
+ expect ( output . warnings . length ) . toBe ( 1 ) ;
30
+ expect ( output . warnings [ 0 ] ) . toBe ( 'another warning' ) ;
31
+
32
+ server . close ( ( ) => {
33
+ res ( ) ;
34
+ } ) ;
35
+ } ) ;
36
+
37
+ compiler . run ( ( ) => { } ) ;
38
+ server . listen ( 8080 , 'localhost' ) ;
39
+ } ) ;
40
+ } ) ;
41
+
19
42
it ( `should cascade stats options` , ( ) => {
20
43
return new Promise ( ( resolve , reject ) => {
21
44
( function iterate ( stats , i ) {
You can’t perform that action at this time.
0 commit comments