lik/test/test.limitedarray.both.ts

18 lines
538 B
TypeScript
Raw Normal View History

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