2017-12-20 01:48:26 +08:00
|
|
|
it("Should use WebpackMissingModule when module is missing with multiple entry setup", function() {
|
|
|
|
var fs = require("fs");
|
2017-12-20 18:36:32 +08:00
|
|
|
var path = require("path");
|
|
|
|
var source = fs.readFileSync(path.join(__dirname, "b.js"), "utf-8");
|
2018-01-27 06:59:38 +08:00
|
|
|
expect(source).toMatch("!(function webpackMissingModule() { var e = new Error(\"Cannot find module \\\"./intentionally-missing-module.js\\\"\"); e.code = 'MODULE_NOT_FOUND'; throw e; }());");
|
2017-12-20 01:48:26 +08:00
|
|
|
|
2018-01-27 06:59:38 +08:00
|
|
|
expect(function() {
|
2017-12-20 01:48:26 +08:00
|
|
|
require("./intentionally-missing-module");
|
2018-01-27 06:59:38 +08:00
|
|
|
}).toThrowError("Cannot find module \"./intentionally-missing-module\"");
|
2017-12-20 01:48:26 +08:00
|
|
|
});
|