File tree Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Expand file tree Collapse file tree 1 file changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -20,24 +20,24 @@ afterEach(function () {
20
20
} ) ;
21
21
22
22
describe ( "computing sum of integers using promises" , function ( ) {
23
- it ( "should compute correct result without blowing stack" , function ( ) {
24
- var array = [ ] ;
25
- var iters = 1000 ;
26
- for ( var i = 1 ; i <= iters ; i ++ ) {
27
- array . push ( i )
28
- }
29
- var pZero = Q . fulfill ( 0 ) ;
30
- var result = array . reduce ( function ( promise , nextVal ) {
31
- return promise . then ( function ( currentVal ) {
32
- var pNext = Q . fulfill ( currentVal + nextVal ) ;
33
- return pNext ;
34
- } ) ;
35
- } , pZero ) ;
36
- result . then ( function ( value ) {
37
- expect ( value ) . toEqual ( iters * ( iters + 1 ) / 2 ) ;
38
- done ( ) ;
39
- } ) ;
40
- } ) ;
23
+ it ( "should compute correct result without blowing stack" , function ( ) {
24
+ var array = [ ] ;
25
+ var iters = 1000 ;
26
+ for ( var i = 1 ; i <= iters ; i ++ ) {
27
+ array . push ( i ) ;
28
+ }
29
+
30
+ var pZero = Q . fulfill ( 0 ) ;
31
+ var result = array . reduce ( function ( promise , nextVal ) {
32
+ return promise . then ( function ( currentVal ) {
33
+ return Q . fulfill ( currentVal + nextVal ) ;
34
+ } ) ;
35
+ } , pZero ) ;
36
+
37
+ return result . then ( function ( value ) {
38
+ expect ( value ) . toEqual ( iters * ( iters + 1 ) / 2 ) ;
39
+ } ) ;
40
+ } ) ;
41
41
} ) ;
42
42
43
43
describe ( "Q function" , function ( ) {
You can’t perform that action at this time.
0 commit comments