fix(core): update
This commit is contained in:
25
test/test.interestmap.ts
Normal file
25
test/test.interestmap.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { tap, expect } from '@pushrocks/tapbundle';
|
||||
import * as lik from '../ts/index';
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
tap.start();
|
@ -31,9 +31,9 @@ tap.test('should add other objects in a hierachy', async () => {
|
||||
testTree.appendChild(testInstance, testInstance2);
|
||||
testTree.appendChild(testInstance, testInstance3);
|
||||
testTree.appendChild(testInstance, testInstance4);
|
||||
})
|
||||
});
|
||||
|
||||
tap.test('should create a JSON object that reflects a tree\'s hierachy', async () => {
|
||||
tap.test("should create a JSON object that reflects a tree's hierachy", async () => {
|
||||
const jsonTreet = testTree.toJsonWithHierachy(testInstance);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user