Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request mochajs#2703 from seppevs/cover_utils_some_fn_with…
Browse files Browse the repository at this point in the history
…_tests

cover .some() function in utils.js with tests
  • Loading branch information
Munter committed Feb 7, 2017
2 parents 2154bfd + 5ea7df9 commit 63daa1c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/utils.spec.js
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 63daa1c

Please sign in to comment.