lik/test/test.limitedarray.ts

18 lines
510 B
TypeScript
Raw Normal View History

2017-09-21 20:54:22 +00:00
import { tap, expect } from 'tapbundle'
import { LimitedArray } from '../ts/index'
let testLimitedArray: LimitedArray<string>
tap.test('should create a LimitedArray', async () => {
testLimitedArray = new LimitedArray(6)
expect(testLimitedArray).to.be.instanceof(LimitedArray)
})
tap.test('should never be longer than the set length', async () => {
testLimitedArray.addMany(['hi','this','is','quite','a','long','string',':)'])
expect(testLimitedArray.array.length).to.be.lessThan(7)
})
tap.start()