Skip to content

Commit 772a7d9

Browse files
Merge pull request #19 from KonanMentor/add-array-test
Add getPositivesCount test
2 parents ab30690 + a6f32d4 commit 772a7d9

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

task/04-arrays-tasks.js

+1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ function get3TopItems(arr) {
301301
* [ -1, 0, 1 ] => 1
302302
* [ 1, 2, 3] => 3
303303
* [ null, 1, 'elephant' ] => 1
304+
* [ 1, '2' ] => 1
304305
*/
305306
function getPositivesCount(arr) {
306307
throw new Error('Not implemented');

test/04-arrays-tests.js

+3
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,9 @@ describe('04-arrays-tasks', function() {
444444
}, {
445445
arr: [ null, 1, 'elephant' ],
446446
expected: 1
447+
}, {
448+
arr: [ 1, '2' ],
449+
expected: 1
447450
}
448451
].forEach(data => {
449452
var actual = tasks.getPositivesCount(data.arr);

0 commit comments

Comments
 (0)