d2/d2js/js/test/integration/cjs.test.js

12 lines
369 B
JavaScript
Raw Normal View History

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