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

26 lines
690 B
TypeScript

import { tap, expect } from '@push.rocks/tapbundle';
import * as lik from '../ts/index.js';
let testInterestmap: lik.InterestMap<number, number>;
tap.test('should create an interestmap', async () => {
testInterestmap = new lik.InterestMap((numberArg) => {
return numberArg.toString();
});
});
tap.test('should create an interest', async () => {
testInterestmap.addInterest(3);
testInterestmap.addInterest(4);
});
tap.test('should return an already existing interest', async () => {
await testInterestmap.addInterest(3);
});
tap.test('should be able to inform about a lost interest', async () => {
testInterestmap.informLostInterest(3);
});
export default tap.start();