fix(core): update

This commit is contained in:
2018-11-23 20:33:44 +01:00
parent 2dba68df8c
commit a7484e791a
12 changed files with 736 additions and 88 deletions

25
test/test.interestmap.ts Normal file
View 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();

View File

@ -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);
});