File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 975975 "anyOf" : [
976976 {
977977 "type" : " object" ,
978+ "additionalProperties" : false ,
978979 "properties" : {
979980 "context" : {
980981 "type" : " string" ,
997998 "type" : " boolean" ,
998999 "description" : " add assets information"
9991000 },
1001+ "env" : {
1002+ "type" : " boolean" ,
1003+ "description" : " add --env information"
1004+ },
1005+ "colors" : {
1006+ "type" : " boolean" ,
1007+ "description" : " `webpack --colors` equivalent"
1008+ },
1009+ "maxModules" : {
1010+ "type" : " number" ,
1011+ "description" : " Set the maximum number of modules to be shown"
1012+ },
10001013 "chunks" : {
10011014 "type" : " boolean" ,
10021015 "description" : " add chunk information"
Original file line number Diff line number Diff line change @@ -199,6 +199,20 @@ describe("Validation", () => {
199199 message : [
200200 " - configuration.context: The provided value \"baz\" is not an absolute path!" ,
201201 ]
202+ } , {
203+ name : "missing stats option" ,
204+ config : {
205+ entry : "foo.js" ,
206+ stats : {
207+ foobar : true
208+ }
209+ } ,
210+ test ( e ) {
211+ e . message . should . startWith ( "Invalid configuration object." ) ;
212+ e . message . split ( "\n" ) . slice ( 1 ) [ 0 ] . should . be . eql (
213+ " - configuration.stats should be one of these:"
214+ ) ;
215+ }
202216 } ] ;
203217 testCases . forEach ( ( testCase ) => {
204218 it ( "should fail validation for " + testCase . name , ( ) => {
@@ -207,6 +221,12 @@ describe("Validation", () => {
207221 } catch ( e ) {
208222 if ( ! ( e instanceof WebpackOptionsValidationError ) )
209223 throw e ;
224+
225+ if ( testCase . test ) {
226+ testCase . test ( e ) ;
227+ return ;
228+ }
229+
210230 e . message . should . startWith ( "Invalid configuration object." ) ;
211231 e . message . split ( "\n" ) . slice ( 1 ) . should . be . eql ( testCase . message ) ;
212232 return ;
You can’t perform that action at this time.
0 commit comments