2016-09-09 04:26:28 +08:00
|
|
|
import d from "library";
|
2017-06-02 20:22:42 +08:00
|
|
|
import { a, b, external } from "library";
|
2025-03-11 14:18:11 +08:00
|
|
|
import * as imoprtStar from "library";
|
2016-09-09 04:26:28 +08:00
|
|
|
|
2021-03-09 03:18:49 +08:00
|
|
|
it(
|
|
|
|
"should be able to import harmony exports from library (" + NAME + ")",
|
|
|
|
function () {
|
|
|
|
expect(d).toBe("default-value");
|
|
|
|
expect(a).toBe("a");
|
|
|
|
expect(b).toBe("b");
|
|
|
|
if (typeof TEST_EXTERNAL !== "undefined" && TEST_EXTERNAL) {
|
|
|
|
expect(external).toEqual(["external"]);
|
|
|
|
expect(external).toBe(require("external"));
|
2025-03-11 14:18:11 +08:00
|
|
|
const { externalA } = imoprtStar
|
|
|
|
expect(externalA).toEqual(["external-a"]);
|
2021-03-09 03:18:49 +08:00
|
|
|
} else {
|
|
|
|
expect(external).toBe("non-external");
|
2025-03-11 14:18:11 +08:00
|
|
|
const { nonExternalA } = imoprtStar;
|
|
|
|
expect(nonExternalA).toBe("non-external-a");
|
2021-03-09 03:18:49 +08:00
|
|
|
}
|
2017-06-02 20:22:42 +08:00
|
|
|
}
|
2021-03-09 03:18:49 +08:00
|
|
|
);
|