Refactor code and tests

This commit is contained in:
Typicode
2015-05-04 19:46:12 +02:00
parent d4f4c33679
commit 0ff4e627f4
4 changed files with 16 additions and 48 deletions

View File

@ -46,28 +46,4 @@ describe('utils', function() {
})
})
describe('limitArray', function() {
it('should return limited array', function() {
var testArray = [
{id: 2, postId: 2},
{id: 3, postId: 4},
{id: 4, postId: 6},
{id: 5, postId: 8},
{id: 6, postId: 9},
{id: 7, postId: 10},
{id: 8, postId: 11},
{id: 9, postId: 12},
{id: 10, postId: 13},
{id: 11, postId: 14},
{id: 12, postId: 15},
{id: 13, postId: 16},
{id: 14, postId: 17},
{id: 15, postId: 18},
{id: 16, postId: 19}
]
assert.deepEqual(utils.limitArray(testArray, 3, 3), testArray.slice(3, 6))
assert.deepEqual(utils.limitArray(testArray, 5, 3), testArray.slice(5, 8))
})
})
})