@@ -255,6 +255,96 @@ describe("Validation", () => {
255255 " - configuration.stats should be one of these:"
256256 ) ;
257257 }
258+ } , {
259+ name : "Invalid plugin provided: bool" ,
260+ config : {
261+ entry : "foo.js" ,
262+ plugins : [
263+ false
264+ ]
265+ } ,
266+ message : [
267+ " - configuration.plugins[0] should be one of these:" ,
268+ " object { apply, ... } | function" ,
269+ " -> Plugin of type object or instanceof Function" ,
270+ " Details:" ,
271+ " * configuration.plugins[0] should be an object." ,
272+ " -> Plugin instance" ,
273+ " * configuration.plugins[0] should be an instance of function" ,
274+ " -> Function acting as plugin"
275+ ]
276+ } , {
277+ name : "Invalid plugin provided: array" ,
278+ config : {
279+ entry : "foo.js" ,
280+ plugins : [
281+ [ ]
282+ ]
283+ } ,
284+ message : [
285+ " - configuration.plugins[0] should be one of these:" ,
286+ " object { apply, ... } | function" ,
287+ " -> Plugin of type object or instanceof Function" ,
288+ " Details:" ,
289+ " * configuration.plugins[0] should be an object." ,
290+ " -> Plugin instance" ,
291+ " * configuration.plugins[0] should be an instance of function" ,
292+ " -> Function acting as plugin"
293+ ]
294+ } , {
295+ name : "Invalid plugin provided: string" ,
296+ config : {
297+ entry : "foo.js" ,
298+ plugins : [ "abc123" ]
299+ } ,
300+ message : [
301+ " - configuration.plugins[0] should be one of these:" ,
302+ " object { apply, ... } | function" ,
303+ " -> Plugin of type object or instanceof Function" ,
304+ " Details:" ,
305+ " * configuration.plugins[0] should be an object." ,
306+ " -> Plugin instance" ,
307+ " * configuration.plugins[0] should be an instance of function" ,
308+ " -> Function acting as plugin"
309+ ]
310+ } , {
311+ name : "Invalid plugin provided: int" ,
312+ config : {
313+ entry : "foo.js" ,
314+ plugins : [
315+ 12
316+ ]
317+ } ,
318+ message : [
319+ " - configuration.plugins[0] should be one of these:" ,
320+ " object { apply, ... } | function" ,
321+ " -> Plugin of type object or instanceof Function" ,
322+ " Details:" ,
323+ " * configuration.plugins[0] should be an object." ,
324+ " -> Plugin instance" ,
325+ " * configuration.plugins[0] should be an instance of function" ,
326+ " -> Function acting as plugin"
327+ ]
328+ } , {
329+ name : "Invalid plugin provided: object without apply function" ,
330+ config : {
331+ entry : "foo.js" ,
332+ plugins : [ { } ]
333+ } ,
334+ message : [
335+ " - configuration.plugins[0] should be one of these:" ,
336+ " object { apply, ... } | function" ,
337+ " -> Plugin of type object or instanceof Function" ,
338+ " Details:" ,
339+ " * configuration.plugins[0] misses the property 'apply'." ,
340+ " function" ,
341+ " -> The run point of the plugin, required method." ,
342+ " * configuration.plugins[0] misses the property 'apply'." ,
343+ " function" ,
344+ " -> The run point of the plugin, required method." ,
345+ " * configuration.plugins[0] should be an instance of function" ,
346+ " -> Function acting as plugin"
347+ ]
258348 } ] ;
259349
260350 testCases . forEach ( ( testCase ) => {
0 commit comments