File tree Expand file tree Collapse file tree 1 file changed +74
-24
lines changed Expand file tree Collapse file tree 1 file changed +74
-24
lines changed Original file line number Diff line number Diff line change @@ -7,40 +7,90 @@ import forEachPair from "./for_each_pair.ts";
77
88Deno . test ( 
99  'Call function for each pair.' , 
10-   ( )  =>  { 
10+   async   ( test )  =>  { 
1111    function  dummyFunction ( 
1212      previousValue  : number , 
13-       currentValue  : number 
14-     )  : void { } 
13+       currentValue  : number , 
14+       currentIndex : number ,  
15+       array : number [ ] 
16+     )  : { 
17+       previousValue  : number , 
18+       currentValue  : number , 
19+       currentIndex : number ,  
20+       array : number [ ] 
21+     }  { 
22+       return  { 
23+         previousValue, 
24+         currentValue, 
25+         currentIndex, 
26+         array
27+       } 
28+     } 
1529
1630    const  dummyFunctionSpy  =  spy ( dummyFunction ) ; 
1731
1832    forEachPair ( 
19-       [ 0 ,  2 ,  3 ,  7 ] , 
33+       [ 
34+         0 , 
35+         2 ,  
36+         3 ,  
37+         7 
38+       ] , 
2039      dummyFunctionSpy 
2140    ) 
22- 
23-     assertSpyCall ( dummyFunctionSpy ,  0 ,  { 
24-       args : [ 
25-         0 , 
26-         2 
27-       ] 
28-     } ) 
29- 
30-     assertSpyCall ( dummyFunctionSpy ,  1 ,  { 
31-       args : [ 
32-         2 , 
33-         3 
34-       ] 
41+     
42+     await  test . step ( { 
43+       name : 'Function call arguments.' , 
44+       fn : ( )  =>  { 
45+         assertSpyCall ( dummyFunctionSpy ,  0 ,  { 
46+           args : [ 
47+             0 , 
48+             2 , 
49+             1 , 
50+             [ 
51+               0 ,  
52+               2 ,  
53+               3 ,  
54+               7 
55+             ] 
56+           ] 
57+         } ) 
58+     
59+         assertSpyCall ( dummyFunctionSpy ,  1 ,  { 
60+           args : [ 
61+             2 , 
62+             3 , 
63+             2 , 
64+             [ 
65+               0 ,  
66+               2 ,  
67+               3 ,  
68+               7 
69+             ] 
70+           ] 
71+         } ) 
72+     
73+         assertSpyCall ( dummyFunctionSpy ,  2 ,  { 
74+           args : [ 
75+             3 , 
76+             7 , 
77+             3 , 
78+             [ 
79+               0 ,  
80+               2 ,  
81+               3 ,  
82+               7 
83+             ] 
84+           ] 
85+         } ) 
86+       } 
3587    } ) 
3688
37-     assertSpyCall ( dummyFunctionSpy ,   2 ,   { 
38-       args :  [ 
39-          3 , 
40-         7 
41-       ] 
89+     await   test . step ( { 
90+       name :  'Function calls.' , 
91+       fn :  ( )   =>   { 
92+         assertSpyCalls ( dummyFunctionSpy ,   3 ) ; 
93+       } 
4294    } ) 
43- 
44-     assertSpyCalls ( dummyFunctionSpy ,  3 ) ; 
4595  } 
4696) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments