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