Skip to content

Commit 9355b5c

Browse files
committed
Feature: Use WebpackMissingModule: test coverage: add relative file read path
1 parent 084c82e commit 9355b5c

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

test/configCases/errors/multi-entry-missing-module/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
it("Should use WebpackMissingModule when module is missing with multiple entry setup", function() {
22
var fs = require("fs");
3-
var source = fs.readFileSync("test/js/config/errors/multi-entry-missing-module/b.js", "utf-8");
3+
var path = require("path");
4+
var source = fs.readFileSync(path.join(__dirname, "b.js"), "utf-8");
45
source.should.containEql("!function(){var n=new Error('Cannot find module \"./intentionally-missing-module.js\"');throw n.code=\"MODULE_NOT_FOUND\",n}()}");
56

67
(function() {

test/configCases/errors/multi-entry-missing-module/webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ module.exports = {
99
},
1010
plugins: [
1111
new IgnorePlugin(new RegExp(/intentionally-missing-module/))
12-
]
12+
],
13+
node: {
14+
__dirname: false
15+
}
1316
};

0 commit comments

Comments
 (0)