1
+ /** @prettier */
1
2
import { expect } from 'chai' ;
2
3
import { zip } from 'rxjs/operators' ;
3
4
import { from } from 'rxjs' ;
@@ -14,19 +15,18 @@ describe('zip legacy', () => {
14
15
rxTestScheduler = new TestScheduler ( observableMatcher ) ;
15
16
} ) ;
16
17
17
- it ( 'should zip the provided observables' , done => {
18
+ it ( 'should zip the provided observables' , ( done ) => {
18
19
const expected = [ 'a1' , 'b2' , 'c3' ] ;
19
20
let i = 0 ;
20
21
21
22
from ( [ 'a' , 'b' , 'c' ] )
22
23
. pipe ( zip ( from ( [ 1 , 2 , 3 ] ) , ( a , b ) : string => a + b ) )
23
- . subscribe (
24
- function ( x ) {
24
+ . subscribe ( {
25
+ next ( x ) {
25
26
expect ( x ) . to . equal ( expected [ i ++ ] ) ;
26
27
} ,
27
- null ,
28
- done
29
- ) ;
28
+ complete : done ,
29
+ } ) ;
30
30
} ) ;
31
31
32
32
it ( 'should work with selector throws' , ( ) => {
@@ -37,7 +37,7 @@ describe('zip legacy', () => {
37
37
const bsubs = ' ^-------! ' ;
38
38
const expected = ' ---x----# ' ;
39
39
40
- const selector = function ( x : string , y : string ) {
40
+ const selector = ( x : string , y : string ) => {
41
41
if ( y === '5' ) {
42
42
throw new Error ( 'too bad' ) ;
43
43
} else {
@@ -61,7 +61,7 @@ describe('zip legacy', () => {
61
61
62
62
expectObservable (
63
63
a . pipe (
64
- zip ( b , function ( r1 , r2 ) {
64
+ zip ( b , ( r1 , r2 ) => {
65
65
return r1 + r2 ;
66
66
} )
67
67
)
@@ -81,7 +81,7 @@ describe('zip legacy', () => {
81
81
82
82
expectObservable (
83
83
a . pipe (
84
- zip ( b , function ( r1 , r2 ) {
84
+ zip ( b , ( r1 , r2 ) => {
85
85
return r1 + r2 ;
86
86
} )
87
87
)
@@ -101,7 +101,7 @@ describe('zip legacy', () => {
101
101
102
102
expectObservable (
103
103
a . pipe (
104
- zip ( b , function ( r1 , r2 ) {
104
+ zip ( b , ( r1 , r2 ) => {
105
105
return r1 + r2 ;
106
106
} )
107
107
)
@@ -121,7 +121,7 @@ describe('zip legacy', () => {
121
121
const expected = ' ----x---y-| ' ;
122
122
123
123
const observable = a . pipe (
124
- zip ( b , c , function ( r0 , r1 , r2 ) {
124
+ zip ( b , c , ( r0 , r1 , r2 ) => {
125
125
return [ r0 , r1 , r2 ] ;
126
126
} )
127
127
) ;
@@ -141,7 +141,7 @@ describe('zip legacy', () => {
141
141
const expected = ' ----x---y-| ' ;
142
142
143
143
const observable = a . pipe (
144
- zip ( b , c , function ( r0 , r1 , r2 ) {
144
+ zip ( b , c , ( r0 , r1 , r2 ) => {
145
145
return [ r0 , r1 , r2 ] ;
146
146
} )
147
147
) ;
@@ -161,7 +161,7 @@ describe('zip legacy', () => {
161
161
162
162
expectObservable (
163
163
a . pipe (
164
- zip ( b , function ( e1 , e2 ) {
164
+ zip ( b , ( e1 , e2 ) => {
165
165
return e1 + e2 ;
166
166
} )
167
167
)
0 commit comments