@@ -54,7 +54,7 @@ describe("Lists unit tests", () => {
5454 } ) ;
5555
5656 it ( "should get out of bound error when getting item from the list" , ( ) => {
57- expect ( ( ) => lists . getItem ( { list : [ 0 , 1 , 2 ] , index : 3 } ) ) . toThrowError ( "Index out of bounds" ) ;
57+ expect ( ( ) => lists . getItem ( { list : [ 0 , 1 , 2 ] , index : 3 } ) ) . toThrow ( "Index out of bounds" ) ;
5858 } ) ;
5959
6060 it ( "should get sublist from the list" , ( ) => {
@@ -184,7 +184,7 @@ describe("Lists unit tests", () => {
184184 } ) ;
185185
186186 it ( "should throw when flipping the list with different lengths" , ( ) => {
187- expect ( ( ) => lists . flipLists ( { list : [ [ 0 , 1 , 2 ] , [ 3 , 4 ] ] } ) ) . toThrowError ( "Lists are not of the same length" ) ;
187+ expect ( ( ) => lists . flipLists ( { list : [ [ 0 , 1 , 2 ] , [ 3 , 4 ] ] } ) ) . toThrow ( "Lists are not of the same length" ) ;
188188 } ) ;
189189
190190 it ( "should multiply the item" , ( ) => {
@@ -203,7 +203,7 @@ describe("Lists unit tests", () => {
203203 } ) ;
204204
205205 it ( "should not flip empty list" , ( ) => {
206- expect ( ( ) => lists . flipLists ( { list : [ ] } ) ) . toThrowError ( "List is empty" ) ;
206+ expect ( ( ) => lists . flipLists ( { list : [ ] } ) ) . toThrow ( "List is empty" ) ;
207207 } ) ;
208208
209209 it ( "should add item to the beginning of the list" , ( ) => {
@@ -312,11 +312,11 @@ describe("Lists unit tests", () => {
312312 } ) ;
313313
314314 it ( "should not add items to list at indexes if the number of items is not the same as indexes" , ( ) => {
315- expect ( ( ) => lists . addItemsAtIndexes ( { list : [ 0 , 1 , 2 ] , indexes : [ 0 , 3 ] , items : [ 3 , 4 , 5 ] } ) ) . toThrowError ( "Items and indexes must have the same length" ) ;
315+ expect ( ( ) => lists . addItemsAtIndexes ( { list : [ 0 , 1 , 2 ] , indexes : [ 0 , 3 ] , items : [ 3 , 4 , 5 ] } ) ) . toThrow ( "Items and indexes must have the same length" ) ;
316316 } ) ;
317317
318318 it ( "should not add items to list at indexes if the indexes are not in ascending order" , ( ) => {
319- expect ( ( ) => lists . addItemsAtIndexes ( { list : [ 0 , 1 , 2 ] , indexes : [ 3 , 0 ] , items : [ 3 , 4 ] } ) ) . toThrowError ( "Indexes must be in ascending order" ) ;
319+ expect ( ( ) => lists . addItemsAtIndexes ( { list : [ 0 , 1 , 2 ] , indexes : [ 3 , 0 ] , items : [ 3 , 4 ] } ) ) . toThrow ( "Indexes must be in ascending order" ) ;
320320 } ) ;
321321
322322 it ( "should remove item from list at index" , ( ) => {
@@ -499,11 +499,11 @@ describe("Lists unit tests", () => {
499499 } ) ;
500500
501501 it ( "should not get the elements by following the empty pattern" , ( ) => {
502- expect ( ( ) => lists . getByPattern ( { list : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] , pattern : [ ] } ) ) . toThrowError ( "Pattern is empty or does not exist" ) ;
502+ expect ( ( ) => lists . getByPattern ( { list : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] , pattern : [ ] } ) ) . toThrow ( "Pattern is empty or does not exist" ) ;
503503 } ) ;
504504
505505 it ( "should not get the elements by following the empty pattern" , ( ) => {
506- expect ( ( ) => lists . getByPattern ( { list : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] , pattern : undefined } ) ) . toThrowError ( "Pattern is empty or does not exist" ) ;
506+ expect ( ( ) => lists . getByPattern ( { list : [ 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] , pattern : undefined } ) ) . toThrow ( "Pattern is empty or does not exist" ) ;
507507 } ) ;
508508
509509 it ( "should get list length" , ( ) => {
@@ -619,7 +619,7 @@ describe("Lists unit tests", () => {
619619 } ) ;
620620
621621 it ( "should throw error when getting first item from empty list" , ( ) => {
622- expect ( ( ) => lists . getFirstItem ( { list : [ ] } ) ) . toThrowError ( "List is empty" ) ;
622+ expect ( ( ) => lists . getFirstItem ( { list : [ ] } ) ) . toThrow ( "List is empty" ) ;
623623 } ) ;
624624
625625 it ( "should get last item from the list" , ( ) => {
@@ -633,7 +633,7 @@ describe("Lists unit tests", () => {
633633 } ) ;
634634
635635 it ( "should throw error when getting last item from empty list" , ( ) => {
636- expect ( ( ) => lists . getLastItem ( { list : [ ] } ) ) . toThrowError ( "List is empty" ) ;
636+ expect ( ( ) => lists . getLastItem ( { list : [ ] } ) ) . toThrow ( "List is empty" ) ;
637637 } ) ;
638638
639639 it ( "should remove first item from the list" , ( ) => {
@@ -821,7 +821,7 @@ describe("Lists unit tests", () => {
821821 } ) ;
822822
823823 it ( "should throw error when interleaving with no lists" , ( ) => {
824- expect ( ( ) => lists . interleave ( { lists : [ ] } ) ) . toThrowError ( "Lists array is empty or does not exist" ) ;
824+ expect ( ( ) => lists . interleave ( { lists : [ ] } ) ) . toThrow ( "Lists array is empty or does not exist" ) ;
825825 } ) ;
826826
827827 it ( "should interleave string lists" , ( ) => {
0 commit comments