lik/test/test.limitedarray.both.ts
2024-04-18 21:55:33 +02:00

18 lines
552 B
TypeScript

import { tap, expect } from '@push.rocks/tapbundle';
import { LimitedArray } from '../ts/index.js';
let testLimitedArray: LimitedArray<string>;
tap.test('should create a LimitedArray', async () => {
testLimitedArray = new LimitedArray(6);
expect(testLimitedArray).toBeInstanceOf(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 < 7).toBeTrue();
});
export default tap.start();