Skip to content

Commit

Permalink
100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaubatz committed Aug 12, 2015
1 parent 7391301 commit cafc94a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/promise-settle.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ describe('settle()', function () {
);
});

it('should reject if the input is not an array', function() {
return settle().catch(function(err) {
assert.ok(err instanceof TypeError);
assert.ok(err.message === 'Expected an array of Promises');
});
});

it('should settle values', function () {
var array = [0, 1, sentinel];
return settle(array).then(function (settled) {
Expand All @@ -71,9 +78,11 @@ describe('settle()', function () {

assert.equal(settled[1].isFulfilled(), true);
assert.deepEqual(settled[1].value(), sentinel);
assert.throws(settled[1].reason, Error);

assert.equal(settled[2].isRejected(), true);
assert.deepEqual(settled[2].reason(), sentinel);
assert.throws(settled[2].value, Error);
});
});

Expand Down

0 comments on commit cafc94a

Please sign in to comment.