Skip to content

Commit

Permalink
Merge pull request jashkenas#1591 from mattrobenolt/better-test
Browse files Browse the repository at this point in the history
Simply assert that a TypeError is raised
  • Loading branch information
jashkenas committed Apr 18, 2014
2 parents 2668d0a + 20c73e0 commit 813d392
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions test/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@
equal(Boundf().hello, 'moe curly', "When called without the new operator, it's OK to be bound to the context");
ok(newBoundf instanceof F, 'a bound instance is an instance of the original function');

raises(
function() { _.bind('notafunction'); },
function(actual) { return actual instanceof TypeError && actual.message !== ''; },
'throws an error when binding to a non-function'
);
raises(function() { _.bind('notafunction'); }, TypeError, 'throws an error when binding to a non-function');
});

test('partial', function() {
Expand Down

0 comments on commit 813d392

Please sign in to comment.