(FunctionNode)
| 5 | |
| 6 | // Three layer template for multiple tests |
| 7 | function threeLayerTemplate(FunctionNode) { |
| 8 | function layerOne() { |
| 9 | return 42; |
| 10 | } |
| 11 | |
| 12 | function layerTwo() { |
| 13 | return layerOne() * 2; |
| 14 | } |
| 15 | |
| 16 | function layerThree() { |
| 17 | return layerTwo() * 2; |
| 18 | } |
| 19 | |
| 20 | // Create a function hello node |
| 21 | return new FunctionBuilder({ |
| 22 | functionNodes: [ |
| 23 | new FunctionNode(layerOne.toString(), { |
| 24 | output: [1], |
| 25 | lookupReturnType: () => 'Number', |
| 26 | lookupFunctionArgumentTypes: () => {} |
| 27 | }), |
| 28 | new FunctionNode(layerTwo.toString(), { |
| 29 | output: [1], |
| 30 | lookupReturnType: () => 'Number', |
| 31 | lookupFunctionArgumentTypes: () => {} |
| 32 | }), |
| 33 | new FunctionNode(layerThree.toString(), { |
| 34 | output: [1], |
| 35 | lookupReturnType: () => 'Number', |
| 36 | lookupFunctionArgumentTypes: () => {} |
| 37 | }), |
| 38 | ], |
| 39 | output: [1] |
| 40 | }); |
| 41 | } |
| 42 | |
| 43 | /// Test the function tracing of 3 layers |
| 44 | test('traceFunctionCalls: 3 layer test cpu', () => { |
no test coverage detected
searching dependent graphs…