MCPcopy Create free account
hub / github.com/aws/constructs / createTree

Function createTree

test/construct.test.ts:678–695  ·  view source on GitHub ↗
(context?: any)

Source from the content-addressed store, hash-verified

676});
677
678function createTree(context?: any) {
679 const root = new Root();
680 const highChild = new Construct(root, 'HighChild');
681 if (context) {
682 Object.keys(context).forEach(key => highChild.node.setContext(key, context[key]));
683 }
684
685 const child1 = new Construct(highChild, 'Child1');
686 const child2 = new Construct(highChild, 'Child2');
687 const child1_1 = new Construct(child1, 'Child11');
688 const child1_2 = new Construct(child1, 'Child12');
689 const child1_1_1 = new Construct(child1_1, 'Child111');
690 const child2_1 = new Construct(child2, 'Child21');
691
692 return {
693 root, child1, child2, child1_1, child1_2, child1_1_1, child2_1,
694 };
695}
696
697class MyBeautifulConstruct extends Construct {
698 constructor(scope: Construct, id: string) {

Callers 1

construct.test.tsFile · 0.85

Calls 1

setContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…