Skip to content

Commit 084c82e

Browse files
committed
Feature: Use WebpackMissingModule: test coverage
1 parent 688a641 commit 084c82e

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
it("Should use WebpackMissingModule when module is missing with multiple entry setup", function() {
2+
var fs = require("fs");
3+
var source = fs.readFileSync("test/js/config/errors/multi-entry-missing-module/b.js", "utf-8");
4+
source.should.containEql("!function(){var n=new Error('Cannot find module \"./intentionally-missing-module.js\"');throw n.code=\"MODULE_NOT_FOUND\",n}()}");
5+
6+
(function() {
7+
require("./intentionally-missing-module");
8+
}).should.throw("Cannot find module \"./intentionally-missing-module\"");
9+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = "ignored";
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const IgnorePlugin = require("../../../../lib/IgnorePlugin");
2+
module.exports = {
3+
entry: {
4+
b: ["./intentionally-missing-module.js"],
5+
bundle0: ["./index"]
6+
},
7+
output: {
8+
filename: "[name].js"
9+
},
10+
plugins: [
11+
new IgnorePlugin(new RegExp(/intentionally-missing-module/))
12+
]
13+
};

0 commit comments

Comments
 (0)