lik/test/test.tree.ts

25 lines
583 B
TypeScript
Raw Normal View History

2017-11-20 08:26:13 +00:00
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()