Fix types in tests

This commit is contained in:
Thomas Nordquist
2019-01-14 11:49:57 +01:00
parent ad78ca03d8
commit fd386bf1df
6 changed files with 41 additions and 36 deletions

View File

@@ -5,7 +5,7 @@ interface HasLength {
}
export abstract class TreeNodeFactory {
public static fromEdgesAndValue<T extends HasLength>(edgeNames: string[], value: T): TreeNode {
public static fromEdgesAndValue<T extends HasLength>(edgeNames: string[], value?: T): TreeNode {
let currentNode: TreeNode = new Tree()
for (const edgeName of edgeNames) {
const edge = new Edge(edgeName)
@@ -17,7 +17,7 @@ export abstract class TreeNodeFactory {
currentNode.setMessage({
value,
length: value.length,
length: value ? value.length : 0,
received: new Date(),
})
return currentNode