lik/test/test.tree.ts
2017-11-20 09:26:13 +01:00

25 lines
583 B
TypeScript

import { tap, expect } from 'tapbundle'
import * as lik from '../ts/index'
let testTree = new lik.Tree<TestClass>()
class TestClass {
constructor (public hey: string) {
// nothing here
}
}
let testInstance = new TestClass('first')
tap.test('create a valid tree instance', async () => {
testTree = new lik.Tree()
expect(testTree).to.be.instanceOf(lik.Tree)
})
tap.test('should insert an object', async () => {
testTree.initialize(testInstance)
let resultArray = testTree.treeToArray(testInstance, {})
expect(resultArray).to.contain(testInstance)
})
tap.start()