Closed kylemas closed 4 years ago
Did you read my message on slack? I explained why it's not working. The outer loop doesn't run when there's only a root node.
On Tue, May 12, 2020, 9:47 PM Kyle Mas notifications@github.com wrote:
Notes:
- 2/3 test cases written are passing; the case where the 'tree does not branch' seems to be failing.
- Tried doing console logs on the 'resolvedRows' variable (returned by the method I wrote) doesn't seem to be returning anything.
- Added a console log statement for inside the for-each loop in my method and it doesn't seem to be reaching that point as well.
for (const idx of nodePath) { if (currentNode.nodeType !== 'formulas') { throw new Error('Failed to get node path') }
currentNode.formulas.forEach((element) => { if (element.resolved) { resolvedRows.push(element.row) console.log("Element pushed") } console.log(resolvedRows) }) currentNode = currentNode.forest[idx]
}
— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/McTano/Rudolf/pull/44#issuecomment-627743111, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFHH6RHO5VDAZZS6XHJQHTRRIQ47ANCNFSM4M2XOEHQ .
Sorry, I didn't catch your last message on Slack! I made some changes and the test cases are passing now.
Good work! Just to be safe, add a test case for the other case, where the tree does have more than one node, but doesn't branch. And make sure to remove all those console.logs.
@McTano Done!
@McTano Changed the input parameters in the RudolfReducer file! Should be working out now.
Notes: