| 1 | import { describe, it } from "node:test"; |
| 2 | import assert from "node:assert/strict"; |
| 3 | |
| 4 | describe("dynamic import", () => { |
| 5 | it("should import lodash-es/add from esm.sh", async () => { |
| 6 | // @ts-expect-error: HTTP URL resolved by our loader at runtime |
| 7 | const mod = await import("https://esm.sh/lodash-es@4.17.21/add"); |
| 8 | assert.equal(typeof mod.default, "function"); |
| 9 | assert.equal(mod.default(1, 2), 3); |
| 10 | }); |
| 11 | }); |
| 12 |