Skip to content

Commit

Permalink
Test out catch
Browse files Browse the repository at this point in the history
  • Loading branch information
5outh committed Jan 18, 2015
1 parent 124e2f2 commit 5c5abe1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/testNanoscope.js
Expand Up @@ -43,6 +43,12 @@ describe('nanoscope', function () {
expect(function () {
lens.unsafePath('a.b.c.d').get();
}).to.throw(TypeError, 'Cannot read property \'d\' of undefined');

// Test that `catch` works as expected
lens.unsafePath('a.b.c.d').catch(function (err) {
return err.message;
}).get().should.equal('Cannot read property \'d\' of undefined');

});

it('should do the same thing as a PluckLens', function () {
Expand Down

0 comments on commit 5c5abe1

Please sign in to comment.