@@ -4,9 +4,9 @@ import {DoneSignature} from '../helpers/test-helper';
4
4
5
5
const Observable = Rx . Observable ;
6
6
7
- /** @test {inspect } */
8
- describe ( 'Observable.prototype.inspect ' , ( ) => {
9
- asDiagram ( 'inspect ' ) ( 'should emit the last value in each time window' , ( ) => {
7
+ /** @test {audit } */
8
+ describe ( 'Observable.prototype.audit ' , ( ) => {
9
+ asDiagram ( 'audit ' ) ( 'should emit the last value in each time window' , ( ) => {
10
10
const e1 = hot ( '-a-xy-----b--x--cxxx-|' ) ;
11
11
const e1subs = '^ !' ;
12
12
const e2 = cold ( '----| ' ) ;
@@ -15,7 +15,7 @@ describe('Observable.prototype.inspect', () => {
15
15
' ^ ! ' ] ;
16
16
const expected = '-----y--------x-----x|' ;
17
17
18
- const result = e1 . inspect ( ( ) => e2 ) ;
18
+ const result = e1 . audit ( ( ) => e2 ) ;
19
19
20
20
expectObservable ( result ) . toBe ( expected ) ;
21
21
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -31,14 +31,14 @@ describe('Observable.prototype.inspect', () => {
31
31
' ^ ! ' ] ;
32
32
const expected = '-----a--------b-----c|' ;
33
33
34
- const result = e1 . inspect ( ( ) => e2 ) ;
34
+ const result = e1 . audit ( ( ) => e2 ) ;
35
35
36
36
expectObservable ( result ) . toBe ( expected ) ;
37
37
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
38
38
expectSubscriptions ( e2 . subscriptions ) . toBe ( e2subs ) ;
39
39
} ) ;
40
40
41
- it ( 'should inspect with duration Observable using next to close the duration' , ( ) => {
41
+ it ( 'should audit with duration Observable using next to close the duration' , ( ) => {
42
42
const e1 = hot ( '-a-xy-----b--x--cxxx-|' ) ;
43
43
const e1subs = '^ !' ;
44
44
const e2 = cold ( '----x-y-z ' ) ;
@@ -47,7 +47,7 @@ describe('Observable.prototype.inspect', () => {
47
47
' ^ ! ' ] ;
48
48
const expected = '-----y--------x-----x|' ;
49
49
50
- const result = e1 . inspect ( ( ) => e2 ) ;
50
+ const result = e1 . audit ( ( ) => e2 ) ;
51
51
52
52
expectObservable ( result ) . toBe ( expected ) ;
53
53
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -64,7 +64,7 @@ describe('Observable.prototype.inspect', () => {
64
64
' ^! ' ] ;
65
65
const expected = '------y-----z-- ' ;
66
66
67
- const result = e1 . inspect ( ( ) => e2 ) ;
67
+ const result = e1 . audit ( ( ) => e2 ) ;
68
68
69
69
expectObservable ( result , unsub ) . toBe ( expected ) ;
70
70
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -83,7 +83,7 @@ describe('Observable.prototype.inspect', () => {
83
83
84
84
const result = e1
85
85
. mergeMap ( ( x : string ) => Observable . of ( x ) )
86
- . inspect ( ( ) => e2 )
86
+ . audit ( ( ) => e2 )
87
87
. mergeMap ( ( x : string ) => Observable . of ( x ) ) ;
88
88
89
89
expectObservable ( result , unsub ) . toBe ( expected ) ;
@@ -102,7 +102,7 @@ describe('Observable.prototype.inspect', () => {
102
102
' ^!' ] ;
103
103
const expected = '-----f-----f-----f-----f-|' ;
104
104
105
- const result = e1 . inspect ( ( ) => e2 ) ;
105
+ const result = e1 . audit ( ( ) => e2 ) ;
106
106
107
107
expectObservable ( result ) . toBe ( expected ) ;
108
108
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -115,7 +115,7 @@ describe('Observable.prototype.inspect', () => {
115
115
const e2 = cold ( '|' ) ;
116
116
const expected = 'abcdefabcdefabcdefabcdefa|' ;
117
117
118
- const result = e1 . inspect ( ( ) => e2 ) ;
118
+ const result = e1 . audit ( ( ) => e2 ) ;
119
119
120
120
expectObservable ( result ) . toBe ( expected ) ;
121
121
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -128,7 +128,7 @@ describe('Observable.prototype.inspect', () => {
128
128
const e2subs = ' ^ !' ;
129
129
const expected = '-----------------------------|' ;
130
130
131
- const result = e1 . inspect ( ( ) => e2 ) ;
131
+ const result = e1 . audit ( ( ) => e2 ) ;
132
132
133
133
expectObservable ( result ) . toBe ( expected ) ;
134
134
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -142,7 +142,7 @@ describe('Observable.prototype.inspect', () => {
142
142
const e2subs = ' ^ !' ;
143
143
const expected = '-----------------------------#' ;
144
144
145
- const result = e1 . inspect ( ( ) => e2 ) ;
145
+ const result = e1 . audit ( ( ) => e2 ) ;
146
146
147
147
expectObservable ( result ) . toBe ( expected ) ;
148
148
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -156,14 +156,14 @@ describe('Observable.prototype.inspect', () => {
156
156
const e2subs = ' (^!) ' ;
157
157
const expected = '----(-#) ' ;
158
158
159
- const result = e1 . inspect ( ( ) => e2 ) ;
159
+ const result = e1 . audit ( ( ) => e2 ) ;
160
160
161
161
expectObservable ( result ) . toBe ( expected ) ;
162
162
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
163
163
expectSubscriptions ( e2 . subscriptions ) . toBe ( e2subs ) ;
164
164
} ) ;
165
165
166
- it ( 'should inspect using durations of constying lengths' , ( ) => {
166
+ it ( 'should audit using durations of constying lengths' , ( ) => {
167
167
const e1 = hot ( 'abcdefabcdabcdefghabca| ' ) ;
168
168
const e1subs = '^ ! ' ;
169
169
const e2 = [ cold ( '-----| ' ) ,
@@ -179,7 +179,7 @@ describe('Observable.prototype.inspect', () => {
179
179
const expected = '-----f---d-------h--c-| ' ;
180
180
181
181
let i = 0 ;
182
- const result = e1 . inspect ( ( ) => e2 [ i ++ ] ) ;
182
+ const result = e1 . audit ( ( ) => e2 [ i ++ ] ) ;
183
183
184
184
expectObservable ( result ) . toBe ( expected ) ;
185
185
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -200,7 +200,7 @@ describe('Observable.prototype.inspect', () => {
200
200
const expected = '-----f---d-------# ' ;
201
201
202
202
let i = 0 ;
203
- const result = e1 . inspect ( ( ) => e2 [ i ++ ] ) ;
203
+ const result = e1 . audit ( ( ) => e2 [ i ++ ] ) ;
204
204
205
205
expectObservable ( result ) . toBe ( expected ) ;
206
206
expectSubscriptions ( e1 . subscriptions ) . toBe ( e1subs ) ;
@@ -220,7 +220,7 @@ describe('Observable.prototype.inspect', () => {
220
220
const expected = '-----f---d# ' ;
221
221
222
222
let i = 0 ;
223
- const result = e1 . inspect ( ( ) => {
223
+ const result = e1 . audit ( ( ) => {
224
224
if ( i === 2 ) {
225
225
throw 'error' ;
226
226
}
@@ -240,7 +240,7 @@ describe('Observable.prototype.inspect', () => {
240
240
const expected = '-----|' ;
241
241
function durationSelector ( ) { return cold ( '-----|' ) ; }
242
242
243
- expectObservable ( e1 . inspect ( durationSelector ) ) . toBe ( expected ) ;
243
+ expectObservable ( e1 . audit ( durationSelector ) ) . toBe ( expected ) ;
244
244
expectSubscriptions ( e1 . subscriptions ) . toBe ( subs ) ;
245
245
} ) ;
246
246
@@ -250,7 +250,7 @@ describe('Observable.prototype.inspect', () => {
250
250
const expected = '-----#' ;
251
251
function durationSelector ( ) { return cold ( '-----|' ) ; }
252
252
253
- expectObservable ( e1 . inspect ( durationSelector ) ) . toBe ( expected ) ;
253
+ expectObservable ( e1 . audit ( durationSelector ) ) . toBe ( expected ) ;
254
254
expectSubscriptions ( e1 . subscriptions ) . toBe ( subs ) ;
255
255
} ) ;
256
256
@@ -260,7 +260,7 @@ describe('Observable.prototype.inspect', () => {
260
260
const expected = '|' ;
261
261
function durationSelector ( ) { return cold ( '-----|' ) ; }
262
262
263
- expectObservable ( e1 . inspect ( durationSelector ) ) . toBe ( expected ) ;
263
+ expectObservable ( e1 . audit ( durationSelector ) ) . toBe ( expected ) ;
264
264
expectSubscriptions ( e1 . subscriptions ) . toBe ( subs ) ;
265
265
} ) ;
266
266
@@ -270,7 +270,7 @@ describe('Observable.prototype.inspect', () => {
270
270
const expected = '-' ;
271
271
function durationSelector ( ) { return cold ( '-----|' ) ; }
272
272
273
- expectObservable ( e1 . inspect ( durationSelector ) ) . toBe ( expected ) ;
273
+ expectObservable ( e1 . audit ( durationSelector ) ) . toBe ( expected ) ;
274
274
expectSubscriptions ( e1 . subscriptions ) . toBe ( subs ) ;
275
275
} ) ;
276
276
@@ -280,15 +280,15 @@ describe('Observable.prototype.inspect', () => {
280
280
const expected = '#' ;
281
281
function durationSelector ( ) { return cold ( '-----|' ) ; }
282
282
283
- expectObservable ( e1 . inspect ( durationSelector ) ) . toBe ( expected ) ;
283
+ expectObservable ( e1 . audit ( durationSelector ) ) . toBe ( expected ) ;
284
284
expectSubscriptions ( e1 . subscriptions ) . toBe ( subs ) ;
285
285
} ) ;
286
286
287
- it ( 'should inspect by promise resolves' , ( done : DoneSignature ) => {
287
+ it ( 'should audit by promise resolves' , ( done : DoneSignature ) => {
288
288
const e1 = Observable . interval ( 10 ) . take ( 5 ) ;
289
289
const expected = [ 0 , 1 , 2 , 3 ] ;
290
290
291
- e1 . inspect ( ( ) => {
291
+ e1 . audit ( ( ) => {
292
292
return new Promise ( ( resolve : any ) => { resolve ( 42 ) ; } ) ;
293
293
} ) . subscribe (
294
294
( x : number ) => {
@@ -308,7 +308,7 @@ describe('Observable.prototype.inspect', () => {
308
308
const expected = [ 0 , 1 , 2 ] ;
309
309
const error = new Error ( 'error' ) ;
310
310
311
- e1 . inspect ( ( x : number ) => {
311
+ e1 . audit ( ( x : number ) => {
312
312
if ( x === 3 ) {
313
313
return new Promise ( ( resolve : any , reject : any ) => { reject ( error ) ; } ) ;
314
314
} else {
0 commit comments