1
+ /** @prettier */
1
2
import { expect } from 'chai' ;
2
3
import { zipAll , mergeMap } from 'rxjs/operators' ;
3
- import { queueScheduler , of , zip } from 'rxjs' ;
4
+ import { queueScheduler , of , zip , scheduled } from 'rxjs' ;
4
5
import { TestScheduler } from 'rxjs/testing' ;
5
6
import { observableMatcher } from '../helpers/observableMatcher' ;
6
7
@@ -45,13 +46,12 @@ describe('zipAll operator', () => {
45
46
let i = 0 ;
46
47
of ( of ( 'a' , 'b' , 'c' ) , of ( 1 , 2 , 3 ) )
47
48
. pipe ( zipAll ( ( a : string , b : number ) => a + b ) )
48
- . subscribe (
49
- ( x ) => {
49
+ . subscribe ( {
50
+ next ( x ) {
50
51
expect ( x ) . to . equal ( expected [ i ++ ] ) ;
51
52
} ,
52
- null ,
53
- done
54
- ) ;
53
+ complete : done ,
54
+ } ) ;
55
55
} ) ;
56
56
57
57
it ( 'should end once one observable completes and its buffer is empty' , ( ) => {
@@ -384,13 +384,12 @@ describe('zipAll operator', () => {
384
384
let i = 0 ;
385
385
of ( of ( 'a' , 'b' , 'c' ) , of ( 1 , 2 ) )
386
386
. pipe ( zipAll ( ( a : string , b : number ) => a + b ) )
387
- . subscribe (
388
- ( x ) => {
387
+ . subscribe ( {
388
+ next : ( x ) => {
389
389
expect ( x ) . to . equal ( expected [ i ++ ] ) ;
390
390
} ,
391
- null ,
392
- done
393
- ) ;
391
+ complete : done ,
392
+ } ) ;
394
393
} ) ;
395
394
396
395
it ( 'should handle a hot observable of observables' , ( ) => {
@@ -731,29 +730,28 @@ describe('zipAll operator', () => {
731
730
732
731
it ( 'should combine two immediately-scheduled observables' , ( done ) => {
733
732
rxTestScheduler . run ( ( ) => {
734
- const a = of ( 1 , 2 , 3 , queueScheduler ) ;
735
- const b = of ( 4 , 5 , 6 , 7 , 8 , queueScheduler ) ;
733
+ const a = scheduled ( [ 1 , 2 , 3 ] , queueScheduler ) ;
734
+ const b = scheduled ( [ 4 , 5 , 6 , 7 , 8 ] , queueScheduler ) ;
736
735
const r = [
737
736
[ 1 , 4 ] ,
738
737
[ 2 , 5 ] ,
739
738
[ 3 , 6 ] ,
740
739
] ;
741
740
let i = 0 ;
742
741
743
- const result = of ( a , b , queueScheduler ) . pipe ( zipAll ( ) ) ;
742
+ const result = scheduled ( [ a , b ] , queueScheduler ) . pipe ( zipAll ( ) ) ;
744
743
745
- result . subscribe (
746
- ( vals ) => {
744
+ result . subscribe ( {
745
+ next ( vals ) {
747
746
expect ( vals ) . to . deep . equal ( r [ i ++ ] ) ;
748
747
} ,
749
- null ,
750
- done
751
- ) ;
748
+ complete : done ,
749
+ } ) ;
752
750
} ) ;
753
751
} ) ;
754
752
755
753
it ( 'should combine a source with an immediately-scheduled source' , ( done ) => {
756
- const a = of ( 1 , 2 , 3 , queueScheduler ) ;
754
+ const a = scheduled ( [ 1 , 2 , 3 ] , queueScheduler ) ;
757
755
const b = of ( 4 , 5 , 6 , 7 , 8 ) ;
758
756
const r = [
759
757
[ 1 , 4 ] ,
@@ -762,15 +760,14 @@ describe('zipAll operator', () => {
762
760
] ;
763
761
let i = 0 ;
764
762
765
- const result = of ( a , b , queueScheduler ) . pipe ( zipAll ( ) ) ;
763
+ const result = scheduled ( [ a , b ] , queueScheduler ) . pipe ( zipAll ( ) ) ;
766
764
767
- result . subscribe (
768
- ( vals ) => {
765
+ result . subscribe ( {
766
+ next ( vals ) {
769
767
expect ( vals ) . to . deep . equal ( r [ i ++ ] ) ;
770
768
} ,
771
- null ,
772
- done
773
- ) ;
769
+ complete : done ,
770
+ } ) ;
774
771
} ) ;
775
772
776
773
it ( 'should not break unsubscription chain when unsubscribed explicitly' , ( ) => {
0 commit comments