kabirgh
2024-02-24 a6417c447af8f0ff203ffb8730e53e4a7dfafb23
quartz/depgraph.test.ts
@@ -39,6 +39,28 @@
    })
  })
  describe("mergeGraph", () => {
    test("merges two graphs", () => {
      const graph = new DepGraph<string>()
      graph.addEdge("A.md", "A.html")
      const other = new DepGraph<string>()
      other.addEdge("B.md", "B.html")
      graph.mergeGraph(other)
      const expected = {
        nodes: ["A.md", "A.html", "B.md", "B.html"],
        edges: [
          ["A.md", "A.html"],
          ["B.md", "B.html"],
        ],
      }
      assert.deepStrictEqual(graph.export(), expected)
    })
  })
  describe("updateIncomingEdgesForNode", () => {
    test("merges when node exists", () => {
      // A.md -> B.md -> B.html