@@ -32,12 +32,6 @@ describe('IteratorObservable', () => {
32
32
} ) . to . throw ( Error , 'object is not iterable' ) ;
33
33
} ) ;
34
34
35
- it ( 'should not accept non-function project' , ( ) => {
36
- expect ( ( ) => {
37
- IteratorObservable . create ( [ ] , 42 ) ;
38
- } ) . to . throw ( Error , 'when provided, `project` must be a function.' ) ;
39
- } ) ;
40
-
41
35
it ( 'should emit members of an array iterator' , ( done : MochaDone ) => {
42
36
const expected = [ 10 , 20 , 30 , 40 ] ;
43
37
IteratorObservable . create ( [ 10 , 20 , 30 , 40 ] )
@@ -55,8 +49,6 @@ describe('IteratorObservable', () => {
55
49
it ( 'should emit members of an array iterator on a particular scheduler' , ( ) => {
56
50
const source = IteratorObservable . create (
57
51
[ 10 , 20 , 30 , 40 ] ,
58
- ( x : number ) => x ,
59
- null ,
60
52
rxTestScheduler
61
53
) ;
62
54
@@ -65,32 +57,12 @@ describe('IteratorObservable', () => {
65
57
expectObservable ( source ) . toBe ( '(abcd|)' , values ) ;
66
58
} ) ;
67
59
68
- it ( 'should emit members of an array iterator on a particular scheduler, project throws' , ( ) => {
69
- const source = IteratorObservable . create (
70
- [ 10 , 20 , 30 , 40 ] ,
71
- ( x : number ) => {
72
- if ( x === 30 ) {
73
- throw 'error' ;
74
- }
75
- return x * x ;
76
- } ,
77
- null ,
78
- rxTestScheduler
79
- ) ;
80
-
81
- const values = { a : 100 , b : 400 } ;
82
-
83
- expectObservable ( source ) . toBe ( '(ab#)' , values ) ;
84
- } ) ;
85
-
86
60
it ( 'should emit members of an array iterator on a particular scheduler, ' +
87
61
'but is unsubscribed early' , ( done : MochaDone ) => {
88
62
const expected = [ 10 , 20 , 30 , 40 ] ;
89
63
90
64
const source = IteratorObservable . create (
91
65
[ 10 , 20 , 30 , 40 ] ,
92
- ( x : number ) => x ,
93
- null ,
94
66
Rx . Scheduler . queue
95
67
) ;
96
68
@@ -110,43 +82,6 @@ describe('IteratorObservable', () => {
110
82
source . subscribe ( subscriber ) ;
111
83
} ) ;
112
84
113
- it ( 'should emit members of an array iterator, and project them' , ( done : MochaDone ) => {
114
- const expected = [ 100 , 400 , 900 , 1600 ] ;
115
- IteratorObservable . create ( [ 10 , 20 , 30 , 40 ] , ( x : number ) => x * x )
116
- . subscribe (
117
- ( x : number ) => { expect ( x ) . to . equal ( expected . shift ( ) ) ; } ,
118
- ( x ) => {
119
- done ( new Error ( 'should not be called' ) ) ;
120
- } , ( ) => {
121
- expect ( expected . length ) . to . equal ( 0 ) ;
122
- done ( ) ;
123
- }
124
- ) ;
125
- } ) ;
126
-
127
- it ( 'should emit members of an array iterator, and project but raise an error' , ( done : MochaDone ) => {
128
- const expected = [ 100 , 400 ] ;
129
- function project ( x ) {
130
- if ( x === 30 ) {
131
- throw new Error ( 'boom' ) ;
132
- } else {
133
- return x * x ;
134
- }
135
- }
136
- IteratorObservable . create ( [ 10 , 20 , 30 , 40 ] , project )
137
- . subscribe (
138
- ( x : number ) => {
139
- expect ( x ) . to . equal ( expected . shift ( ) ) ;
140
- } ,
141
- ( err : any ) => {
142
- expect ( expected . length ) . to . equal ( 0 ) ;
143
- expect ( err . message ) . to . equal ( 'boom' ) ;
144
- done ( ) ;
145
- } , ( ) => {
146
- done ( new Error ( 'should not be called' ) ) ;
147
- } ) ;
148
- } ) ;
149
-
150
85
it ( 'should emit characters of a string iterator' , ( done : MochaDone ) => {
151
86
const expected = [ 'f' , 'o' , 'o' ] ;
152
87
IteratorObservable . create ( 'foo' )
@@ -161,20 +96,6 @@ describe('IteratorObservable', () => {
161
96
) ;
162
97
} ) ;
163
98
164
- it ( 'should emit characters of a string iterator, and project them' , ( done : MochaDone ) => {
165
- const expected = [ 'F' , 'O' , 'O' ] ;
166
- IteratorObservable . create ( 'foo' , ( x : string ) => x . toUpperCase ( ) )
167
- . subscribe (
168
- ( x : string ) => { expect ( x ) . to . equal ( expected . shift ( ) ) ; } ,
169
- ( x ) => {
170
- done ( new Error ( 'should not be called' ) ) ;
171
- } , ( ) => {
172
- expect ( expected . length ) . to . equal ( 0 ) ;
173
- done ( ) ;
174
- }
175
- ) ;
176
- } ) ;
177
-
178
99
it ( 'should be possible to unsubscribe in the middle of the iteration' , ( done : MochaDone ) => {
179
100
const expected = [ 10 , 20 , 30 ] ;
180
101
0 commit comments