add test case

This commit is contained in:
Tobias Koppers 2020-09-17 11:23:03 +02:00
parent e29e3cdc0d
commit ce71f9b6ab
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,7 @@
it("should allow to work without shared modules", async () => {
await __webpack_init_sharing__("default");
const container = __non_webpack_require__("./container.js");
container.init(__webpack_share_scopes__.default);
const moduleFactory = await container.get("./module");
expect(moduleFactory().ok).toBe(true);
});

View File

@ -0,0 +1 @@
export const ok = true;

View File

@ -0,0 +1,13 @@
const { ModuleFederationPlugin } = require("../../../../").container;
/** @type {import("../../../../").Configuration} */
module.exports = {
plugins: [
new ModuleFederationPlugin({
name: "container",
filename: "container.js",
library: { type: "commonjs-module" },
exposes: ["./module"]
})
]
};