Capping version chistory to 50

This commit is contained in:
Kasra Bigdeli
2019-04-04 22:14:59 -07:00
parent c6a0c167e8
commit b50c632d89
4 changed files with 70 additions and 0 deletions

53
tests/utils.test..ts Normal file
View File

@@ -0,0 +1,53 @@
import Utils from '../src/utils/Utils'
test('Testing dropFirstElements - larger', () => {
const originalArray = []
for (let index = 0; index < 20; index++) {
originalArray.push('A' + index)
}
expect(Utils.dropFirstElements(originalArray, 2).join(',')) //
.toBe('A18,A19')
})
test('Testing dropFirstElements - same', () => {
const originalArray = []
for (let index = 0; index < 2; index++) {
originalArray.push('A' + index)
}
expect(Utils.dropFirstElements(originalArray, 2).join(',')) //
.toBe('A0,A1')
})
test('Testing dropFirstElements - smaller', () => {
const originalArray = []
for (let index = 0; index < 2; index++) {
originalArray.push('A' + index)
}
expect(Utils.dropFirstElements(originalArray, 3).join(',')) //
.toBe('A0,A1')
})
test('Testing dropFirstElements - smaller (1)', () => {
const originalArray = []
for (let index = 0; index < 1; index++) {
originalArray.push('A' + index)
}
expect(Utils.dropFirstElements(originalArray, 3).join(',')) //
.toBe('A0')
})
test('Testing dropFirstElements - smaller (0)', () => {
const originalArray = []
for (let index = 0; index < 0; index++) {
originalArray.push('A' + index)
}
expect(Utils.dropFirstElements(originalArray, 3).join(',')) //
.toBe('')
})