Skip to content

Commit

Permalink
test: adds chain test
Browse files Browse the repository at this point in the history
  • Loading branch information
waynevanson authored and gcanti committed Oct 30, 2020
1 parent 9648e08 commit 5be892e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/StateReaderObservableEither.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ describe('stateReaderObservableEither', () => {
assert.deepStrictEqual(x, [E.left(3)])
})

test('chain', async () => {
const fa = SROBE.right<number, number, number, number>(3)
const fab = SROBE.right<number, number, number, number>(6)
const srobe = pipe(
fa,
SROBE.chain(() => fab),
buffer
)
const x = await srobe(1)(2)()
assert.deepStrictEqual(x, [E.right([6, 1])])
})

test('throwError', async () => {
const srobe = pipe(SROBE.throwError<number, number, number, number>(3), buffer)
const x = await srobe(1)(2)()
Expand Down

0 comments on commit 5be892e

Please sign in to comment.