Skip to content

Commit

Permalink
test(function-tree): ensure inputs are passed correctly with empty paths
Browse files Browse the repository at this point in the history
  • Loading branch information
christianalfoni committed Nov 24, 2016
1 parent e108f32 commit 8046fbc
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/function-tree/src/FunctionTree.test.js
Expand Up @@ -240,4 +240,23 @@ describe('FunctionTree', () => {
assert(branchStartCount, 2)
assert(branchEndCount, 2)
})
it('should pass correct input on empty paths', () => {
function actionA ({path}) {
return path.true()
}
function actionB ({input}) {
assert.deepEqual(input, {foo: 'bar'})
}
const execute = FunctionTree([])
const tree = [
actionA, {
true: [],
false: []
},
actionB
]
execute(tree, {
foo: 'bar'
})
})
})

0 comments on commit 8046fbc

Please sign in to comment.