Skip to content

Commit

Permalink
test(cata): add tests for non catamorphic monads
Browse files Browse the repository at this point in the history
Ref #58
  • Loading branch information
char0n committed Apr 27, 2017
1 parent 1c6fdc6 commit 905dc4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/cata.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,10 @@ describe('cata', function() {
chai.assert.throws(RA.cata.bind(null, identity, null, eitherR), TypeError);
eq(RA.cata(null, identity, eitherR), 1);
});

it('tests on monad without catamorphic behavior', function() {
chai.assert.throws(RA.cata.bind(null, identity, identity, {}), TypeError);
chai.assert.throws(RA.cata.bind(null, identity, identity, null), TypeError);
chai.assert.throws(RA.cata.bind(null, identity, identity, undefined), TypeError);
});
});

0 comments on commit 905dc4f

Please sign in to comment.