11import Tree from '../tree' ;
22import { networkInterfaces } from 'os' ;
33
4+
5+
6+
47describe ( 'Tree unit test' , ( ) => {
58 const newTree = new Tree ( { } ) ;
69
@@ -30,6 +33,8 @@ describe('Tree unit test', () => {
3033 } ) ;
3134
3235 /**
36+ *
37+ * making sure to adhere to ts practices when goign through tests
3338 *
3439 * ^^
3540 * the tree should have initial values of state,
@@ -62,9 +67,9 @@ describe('Tree unit test', () => {
6267 } ) ;
6368
6469 describe ( 'Adding sibling' , ( ) => {
65- let newTree = new Tree ( { } ) ;
66- let returnChild = newTree . addChild ( 'stateful' , 'child' , { } , null ) ;
67- let returnSibling = returnChild . addSibling ( 'stateful' , 'child' , { } , null ) ;
70+ // const newTree = new Tree({});
71+ const returnChild = newTree . addChild ( 'stateful' , 'child' , { } , null ) ;
72+ const returnSibling = returnChild . addSibling ( 'stateful' , 'child' , { } , null ) ;
6873
6974 it ( 'the tree now has 2 children' , ( ) => {
7075 expect ( newTree . children . length ) . toBe ( 2 ) ;
@@ -81,11 +86,17 @@ describe('Tree unit test', () => {
8186 } )
8287 } )
8388
89+
90+
91+ // review this test
92+ // returnSibling not used?
93+ // Check Test
94+
8495 describe ( 'Copy & clean tree' , ( ) => {
85- let newTree = new Tree ( { } ) ;
86- let returnChild = newTree . addChild ( 'stateful' , 'child' , { } , null ) ;
87- let returnSibling = returnChild . addSibling ( 'stateful' , 'child' , { } , null ) ;
88- let copy = newTree . cleanTreeCopy ( ) ;
96+ // const newTree = new Tree({});
97+ const returnChild = newTree . addChild ( 'stateful' , 'child' , { } , null ) ;
98+ const returnSibling = returnChild . addSibling ( 'stateful' , 'child' , { } , null ) ;
99+ const copy = newTree . cleanTreeCopy ( ) ;
89100 it ( 'its copy has 2 children' , ( ) => {
90101 expect ( copy . children . length ) . toEqual ( 2 ) ;
91102 } )
0 commit comments