lik/test/test.interestmap.both.ts

26 lines
690 B
TypeScript
Raw Permalink Normal View History

2024-04-18 19:55:33 +00:00
import { tap, expect } from '@push.rocks/tapbundle';
2022-05-27 15:53:02 +00:00
import * as lik from '../ts/index.js';
2018-11-23 19:33:44 +00:00
let testInterestmap: lik.InterestMap<number, number>;
tap.test('should create an interestmap', async () => {
2020-07-12 00:44:50 +00:00
testInterestmap = new lik.InterestMap((numberArg) => {
2018-11-23 19:33:44 +00:00
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);
});
2024-04-18 19:55:33 +00:00
export default tap.start();