mirror of https://github.com/webpack/webpack.git
Feature: Use WebpackMissingModule: test coverage
This commit is contained in:
parent
688a641e9b
commit
084c82edab
|
|
@ -0,0 +1,9 @@
|
|||
it("Should use WebpackMissingModule when module is missing with multiple entry setup", function() {
|
||||
var fs = require("fs");
|
||||
var source = fs.readFileSync("test/js/config/errors/multi-entry-missing-module/b.js", "utf-8");
|
||||
source.should.containEql("!function(){var n=new Error('Cannot find module \"./intentionally-missing-module.js\"');throw n.code=\"MODULE_NOT_FOUND\",n}()}");
|
||||
|
||||
(function() {
|
||||
require("./intentionally-missing-module");
|
||||
}).should.throw("Cannot find module \"./intentionally-missing-module\"");
|
||||
});
|
||||
|
|
@ -0,0 +1 @@
|
|||
module.exports = "ignored";
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
const IgnorePlugin = require("../../../../lib/IgnorePlugin");
|
||||
module.exports = {
|
||||
entry: {
|
||||
b: ["./intentionally-missing-module.js"],
|
||||
bundle0: ["./index"]
|
||||
},
|
||||
output: {
|
||||
filename: "[name].js"
|
||||
},
|
||||
plugins: [
|
||||
new IgnorePlugin(new RegExp(/intentionally-missing-module/))
|
||||
]
|
||||
};
|
||||
Loading…
Reference in New Issue