@@ -16,7 +16,11 @@ describe('arrays', () => {
1616 it ( 'should split array into chunks of specified size' , ( ) => {
1717 const arr = [ 1 , 2 , 3 , 4 , 5 , 6 ]
1818 const result = arrayChunk ( arr , 2 )
19- expect ( result ) . toEqual ( [ [ 1 , 2 ] , [ 3 , 4 ] , [ 5 , 6 ] ] )
19+ expect ( result ) . toEqual ( [
20+ [ 1 , 2 ] ,
21+ [ 3 , 4 ] ,
22+ [ 5 , 6 ] ,
23+ ] )
2024 } )
2125
2226 it ( 'should handle uneven chunks' , ( ) => {
@@ -28,7 +32,10 @@ describe('arrays', () => {
2832 it ( 'should default to chunk size of 2' , ( ) => {
2933 const arr = [ 1 , 2 , 3 , 4 ]
3034 const result = arrayChunk ( arr )
31- expect ( result ) . toEqual ( [ [ 1 , 2 ] , [ 3 , 4 ] ] )
35+ expect ( result ) . toEqual ( [
36+ [ 1 , 2 ] ,
37+ [ 3 , 4 ] ,
38+ ] )
3239 } )
3340
3441 it ( 'should handle single element arrays' , ( ) => {
@@ -45,8 +52,12 @@ describe('arrays', () => {
4552
4653 it ( 'should throw error for chunk size <= 0' , ( ) => {
4754 const arr = [ 1 , 2 , 3 ]
48- expect ( ( ) => arrayChunk ( arr , 0 ) ) . toThrow ( 'Chunk size must be greater than 0' )
49- expect ( ( ) => arrayChunk ( arr , - 1 ) ) . toThrow ( 'Chunk size must be greater than 0' )
55+ expect ( ( ) => arrayChunk ( arr , 0 ) ) . toThrow (
56+ 'Chunk size must be greater than 0' ,
57+ )
58+ expect ( ( ) => arrayChunk ( arr , - 1 ) ) . toThrow (
59+ 'Chunk size must be greater than 0' ,
60+ )
5061 } )
5162
5263 it ( 'should handle chunk size larger than array' , ( ) => {
@@ -58,7 +69,10 @@ describe('arrays', () => {
5869 it ( 'should work with readonly arrays' , ( ) => {
5970 const arr : readonly number [ ] = [ 1 , 2 , 3 , 4 ]
6071 const result = arrayChunk ( arr , 2 )
61- expect ( result ) . toEqual ( [ [ 1 , 2 ] , [ 3 , 4 ] ] )
72+ expect ( result ) . toEqual ( [
73+ [ 1 , 2 ] ,
74+ [ 3 , 4 ] ,
75+ ] )
6276 } )
6377 } )
6478
0 commit comments