@@ -97,27 +97,28 @@ describe('Util', () => {
9797 } ) ;
9898
9999 it ( 'diff only 1' , ( ) => {
100- expect ( findListDiffIndex ( [ 0 , 1 , 2 ] , [ ] , num => num ) ) . toEqual ( {
100+ const indexArray = [ 0 , 1 , 2 ] ;
101+ expect ( findListDiffIndex ( indexArray , [ ] , num => num ) ) . toEqual ( {
101102 index : 0 ,
102103 multiple : true ,
103104 } ) ;
104- expect ( findListDiffIndex ( [ 0 , 1 , 2 ] , [ 1 , 2 ] , num => num ) ) . toEqual ( {
105+ expect ( findListDiffIndex ( indexArray , [ 1 , 2 ] , num => num ) ) . toEqual ( {
105106 index : 0 ,
106107 multiple : false ,
107108 } ) ;
108- expect ( findListDiffIndex ( [ 0 , 1 , 2 ] , [ 0 , 2 ] , num => num ) ) . toEqual ( {
109+ expect ( findListDiffIndex ( indexArray , [ 0 , 2 ] , num => num ) ) . toEqual ( {
109110 index : 1 ,
110111 multiple : false ,
111112 } ) ;
112- expect ( findListDiffIndex ( [ 0 , 1 , 2 ] , [ 0 , 1 ] , num => num ) ) . toEqual ( {
113+ expect ( findListDiffIndex ( indexArray , [ 0 , 1 ] , num => num ) ) . toEqual ( {
113114 index : 2 ,
114115 multiple : false ,
115116 } ) ;
116- expect ( findListDiffIndex ( [ 0 , 1 , 2 ] , [ 0 ] , num => num ) ) . toEqual ( {
117+ expect ( findListDiffIndex ( indexArray , [ 0 ] , num => num ) ) . toEqual ( {
117118 index : 1 ,
118119 multiple : true ,
119120 } ) ;
120- expect ( findListDiffIndex ( [ 0 , 1 , 2 ] , [ 1 ] , num => num ) ) . toEqual ( {
121+ expect ( findListDiffIndex ( indexArray , [ 1 ] , num => num ) ) . toEqual ( {
121122 index : 0 ,
122123 multiple : true ,
123124 } ) ;
0 commit comments