Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"strictEqual": false,
"notStrictEqual": false,
"notEqual": false,
"raises": false,
"throws": false,
"asyncTest": false,
"start": false
Expand Down
8 changes: 4 additions & 4 deletions test/collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@
equal(_.reduce([], _.noop, undefined), undefined, 'undefined can be passed as a special case');
equal(_.reduce([_], _.noop), _, 'collection of length one with no initial value returns the first item');

raises(function() { _.reduce([], _.noop); }, TypeError, 'throws an error for empty arrays with no initial value');
raises(function() {_.reduce(null, _.noop);}, TypeError, 'handles a null (without initial value) properly');
throws(function() { _.reduce([], _.noop); }, TypeError, 'throws an error for empty arrays with no initial value');
throws(function() {_.reduce(null, _.noop);}, TypeError, 'handles a null (without initial value) properly');
});

test('foldl', function() {
Expand All @@ -151,8 +151,8 @@

equal(_.reduceRight([], _.noop, undefined), undefined, 'undefined can be passed as a special case');

raises(function() { _.reduceRight([], _.noop); }, TypeError, 'throws an error for empty arrays with no initial value');
raises(function() {_.reduceRight(null, _.noop);}, TypeError, 'handles a null (without initial value) properly');
throws(function() { _.reduceRight([], _.noop); }, TypeError, 'throws an error for empty arrays with no initial value');
throws(function() {_.reduceRight(null, _.noop);}, TypeError, 'handles a null (without initial value) properly');

// Assert that the correct arguments are being passed.

Expand Down
8 changes: 4 additions & 4 deletions test/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,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'); }, TypeError, 'throws an error when binding to a non-function');
throws(function() { _.bind('notafunction'); }, TypeError, 'throws an error when binding to a non-function');
});

test('partial', function() {
Expand Down Expand Up @@ -81,9 +81,9 @@
sayLast : function() { return this.sayHi(_.last(arguments)); }
};

raises(function() { _.bindAll(moe); }, Error, 'throws an error for bindAll with no functions named');
raises(function() { _.bindAll(moe, 'sayBye'); }, TypeError, 'throws an error for bindAll if the given key is undefined');
raises(function() { _.bindAll(moe, 'name'); }, TypeError, 'throws an error for bindAll if the given key is not a function');
throws(function() { _.bindAll(moe); }, Error, 'throws an error for bindAll with no functions named');
throws(function() { _.bindAll(moe, 'sayBye'); }, TypeError, 'throws an error for bindAll if the given key is undefined');
throws(function() { _.bindAll(moe, 'name'); }, TypeError, 'throws an error for bindAll if the given key is not a function');

_.bindAll(moe, 'sayHi', 'sayLast');
curly.sayHi = moe.sayHi;
Expand Down