@@ -116,6 +116,12 @@ describe('LinkedList Test', () => {
116116      linkedList . addLast ( 'found' ) ; 
117117    } ) ; 
118118
119+     describe ( '#length' ,  ( )  =>  { 
120+       it ( 'should have length property' ,  ( )  =>  { 
121+         expect ( linkedList . length ) . toBe ( 2 ) ; 
122+       } ) ; 
123+     } ) ; 
124+ 
119125    describe ( '#indexOf' ,  ( )  =>  { 
120126      it ( 'should find element index' ,  ( )  =>  { 
121127        expect ( linkedList . indexOf ( 0 ) ) . toBe ( 0 ) ; 
@@ -203,6 +209,20 @@ describe('LinkedList Test', () => {
203209        expect ( linkedList . size ) . toBe ( 2 ) ; 
204210      } ) ; 
205211    } ) ; 
212+ 
213+     describe ( '#removeByPosition' ,  ( )  =>  { 
214+       it ( 'should remove last element' ,  ( )  =>  { 
215+         expect ( linkedList . length ) . toBe ( 2 ) ; 
216+         expect ( linkedList . removeByPosition ( 1 ) ) . toBe ( 'found' ) ; 
217+         expect ( linkedList . length ) . toBe ( 1 ) ; 
218+       } ) ; 
219+ 
220+       it ( 'should remove last element' ,  ( )  =>  { 
221+         expect ( linkedList . length ) . toBe ( 2 ) ; 
222+         expect ( linkedList . removeByPosition ( 0 ) ) . toBe ( 0 ) ; 
223+         expect ( linkedList . length ) . toBe ( 1 ) ; 
224+       } ) ; 
225+     } ) ; 
206226  } ) ; 
207227
208228  describe ( 'Doubly Linked List and aliases' ,  ( )  =>  { 
0 commit comments