Skip to content

Commit 7b29694

Browse files
committed
Add plugin validation error test
1 parent cdd593b commit 7b29694

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "foo";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use strict";
2+
3+
module.exports = function testAssertions(code, stdout, stderr) {
4+
code.should.be.eql(1);
5+
stdout.should.be.empty();
6+
7+
stderr[1].should.containEql("Commons Chunk Plugin Invalid Options");
8+
9+
stderr[3].should.containEql("options should be string");
10+
stderr[4].should.containEql("options should be array");
11+
stderr[5].should.containEql("options['foo'] should NOT have additional properties");
12+
stderr[6].should.containEql("options should match exactly one schema in oneOf");
13+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var path = require("path");
2+
var webpack = require("../../../../lib/webpack");
3+
4+
module.exports = {
5+
entry: path.resolve(__dirname, "./index"),
6+
plugins: [
7+
new webpack.optimize.CommonsChunkPlugin({
8+
foo: "bar"
9+
})
10+
]
11+
};

0 commit comments

Comments
 (0)