mirror of https://github.com/webpack/webpack.git
add providedInfo test case
This commit is contained in:
parent
d3a0f8de03
commit
6eff5de1df
|
@ -0,0 +1 @@
|
|||
module.exports = require("./cjs3");
|
|
@ -0,0 +1,3 @@
|
|||
exports.a = 1;
|
||||
exports.b = 2;
|
||||
exports.cjs3DefaultProvidedInfo = __webpack_exports_info__.default.provideInfo;
|
|
@ -0,0 +1,2 @@
|
|||
export default 2;
|
||||
export const esmDefaultProvidedInfo = __webpack_exports_info__.default.provideInfo;
|
|
@ -1,6 +1,19 @@
|
|||
import * as C from "./reexport-namespace";
|
||||
import { counter } from "./reexport-namespace";
|
||||
import * as C2 from "./reexport-namespace-again";
|
||||
import cj2, { cjs3DefaultProvidedInfo } from "./cjs2";
|
||||
import esm1, { esmDefaultProvidedInfo } from "./esm1";
|
||||
|
||||
it("default providedInfo should be correct for cjs", () => {
|
||||
expect(cj2.a).toBe(1);
|
||||
expect(cjs3DefaultProvidedInfo).toBe(false);
|
||||
expect(__webpack_exports_info__.cj2.default.provideInfo).toBe(false);
|
||||
});
|
||||
|
||||
it("default providedInfo and usedInfo should be correct for esm", () => {
|
||||
expect(esm1).toBe(2);
|
||||
expect(esmDefaultProvidedInfo).toBe(true);
|
||||
});
|
||||
|
||||
it("should allow to reexport namespaces 1", () => {
|
||||
(0, counter.reset)();
|
||||
|
|
Loading…
Reference in New Issue