2025-01-12 14:41:58 +00:00
|
|
|
import { expect, test, describe } from "bun:test";
|
2025-01-12 19:08:17 +00:00
|
|
|
import { D2 } from "../../dist/node-esm/index.js";
|
2025-01-12 14:41:58 +00:00
|
|
|
|
|
|
|
|
describe("D2 ESM Integration", () => {
|
|
|
|
|
test("can import and use ESM build", async () => {
|
|
|
|
|
const d2 = new D2();
|
|
|
|
|
const result = await d2.compile("x -> y");
|
|
|
|
|
expect(result.diagram).toBeDefined();
|
|
|
|
|
await d2.worker.terminate();
|
|
|
|
|
}, 20000);
|
|
|
|
|
});
|