forked from webpack/webpack
/
index.js
20 lines (18 loc) · 828 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
it("should load the component from container", async () => {
await __webpack_init_sharing__("test-scope");
// 2 scopes for "0-container-full-mjs" & "mf-with-shareScope-mjs"
expect(Object.keys(__webpack_share_scopes__["test-scope"].react).length).toBe(2);
return import("./App").then(({ default: App }) => {
const rendered = App();
expect(rendered).toBe(
"App rendered with [This is react 2.1.0] and [ComponentA rendered with [This is react 2.1.0]] and [ComponentB rendered with [This is react 2.1.0]]"
);
return import("./upgrade-react").then(({ default: upgrade }) => {
upgrade();
const rendered = App();
expect(rendered).toBe(
"App rendered with [This is react 3.2.1] and [ComponentA rendered with [This is react 3.2.1]] and [ComponentB rendered with [This is react 3.2.1]]"
);
});
});
});