mirror of https://github.com/webpack/webpack.git
add test for exit status when encountering child compilation error
This commit is contained in:
parent
71efc0db63
commit
d2c3049166
|
@ -0,0 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = function testAssertions(code, stdout, stderr) {
|
||||
code.should.be.eql(2);
|
||||
|
||||
stdout[0].should.containEql("Hash: ");
|
||||
stdout[1].should.containEql("Version: ");
|
||||
stdout[2].should.containEql("Time: ");
|
||||
stdout[5].should.containEql("./index.js");
|
||||
stdout[8].should.containEql("ERROR in child compilation");
|
||||
|
||||
stderr.should.be.empty();
|
||||
};
|
|
@ -0,0 +1,19 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
entry: "./index",
|
||||
output: {
|
||||
filename: "bundle.js"
|
||||
},
|
||||
plugins: [{
|
||||
apply(compiler) {
|
||||
compiler.plugin("make", (compilation, cb) => {
|
||||
const child = compilation.createChildCompiler("child", {});
|
||||
child.plugin("compilation", childCompilation => {
|
||||
childCompilation.errors.push(new Error("child compilation"));
|
||||
});
|
||||
child.runAsChild(cb);
|
||||
});
|
||||
}
|
||||
}]
|
||||
};
|
Loading…
Reference in New Issue