Skip to content

Commit

Permalink
cover .some() function in utils.js with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
seppevs committed Feb 7, 2017
1 parent f42cbf4 commit ed61cd0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,24 @@ describe('utils', function () {
});
});

describe('.some()', function () {
var some = utils.some;

it('should return true when some array elements pass the check of the fn parameter', function () {
var result = some(['a', 'b', 'c'], function (e) {
return e === 'b';
});
result.should.eql(true);
});

it('should return false when none of the array elements pass the check of the fn parameter', function () {
var result = some(['a', 'b', 'c'], function (e) {
return e === 'd';
});
result.should.eql(false);
});
});

describe('.parseQuery()', function () {
var parseQuery = utils.parseQuery;
it('should get queryString and return key-value object', function () {
Expand Down

0 comments on commit ed61cd0

Please sign in to comment.