MCPcopy
hub / github.com/simstudioai/sim / createDAG

Function createDAG

apps/sim/executor/utils/run-from-block.test.ts:52–73  ·  view source on GitHub ↗

* Helper to create a DAG for testing

(nodes: DAGNode[])

Source from the content-addressed store, hash-verified

50 * Helper to create a DAG for testing
51 */
52function createDAG(nodes: DAGNode[]): DAG {
53 const nodeMap = new Map<string, DAGNode>()
54 for (const node of nodes) {
55 nodeMap.set(node.id, node)
56 }
57
58 // Set up incoming edges based on outgoing edges
59 for (const node of nodes) {
60 for (const [, edge] of node.outgoingEdges) {
61 const targetNode = nodeMap.get(edge.target)
62 if (targetNode) {
63 targetNode.incomingEdges.add(node.id)
64 }
65 }
66 }
67
68 return {
69 nodes: nodeMap,
70 loopConfigs: new Map<string, SerializedLoop>(),
71 parallelConfigs: new Map<string, SerializedParallel>(),
72 }
73}
74
75describe('computeDirtySet', () => {
76 it('includes start block in dirty set', () => {

Callers 1

Calls 3

setMethod · 0.65
getMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected